Questions tagged [.net-6.0]
For questions about Microsoft's .NET application development framework that are specific to version 6.0+ of the framework. Use only If your question are version-specific
5,749
questions
0
votes
0
answers
32
views
.Net 6 Minimal API Define Enum Parameter In Swagger
Is there a way to describe an enum in Swagger using a minimal API like there is for a controller-based API?
I have a simple enum:
public enum GeometryType
{
WKT,
GeoJson
}
and an endpoint:
...
0
votes
0
answers
10
views
How to we consume traditional Webservice from .NET 6 API using client and server authentication and using proxy class from WSDL
I have .Net 6 API and have a use case to consume SOAP service. I have created proxy class from the WSDL file and connect using client/server certificate authentication.
In .net framework, we can add ...
0
votes
1
answer
33
views
Visual Studio - Upgrading Project from .NET 6 to .NET 8
I am trying to upgrade my WinUI 3 project from NET 6 to NET 8 in Visual Studio 2022. I changed the target framework to net8.0 as many tutorials suggest but I get the following error:
Error MSB4086 A ...
0
votes
1
answer
24
views
RedirectToAction causes "No route matches the supplied values" after adding a controller to the ASP.NET .NET6 Razor app
I have a project, where I use the RedirectToAction Method to notify the app when some special data should be delivered to the website.
So I use the standard OnGet Method to decide which data must be ...
0
votes
0
answers
12
views
Steema TeeChart Issues on IIS
I have an evaluation version of Steema TeeChart running in a method in a .net6 WebApi. The method uses TeeChart to create charts in a PDF document which is then returned as a base64 encoded string to ...
0
votes
0
answers
46
views
call url on azure app service with authentication and authorization from Webjobs (or better way)
net 6 web app running on app service, with authentication over AAD + app roles on app registration, i need something that will call me specific action on that app service every 2hours for example
//...
0
votes
1
answer
23
views
Systems.Collections.Generic.List
The model item passed into the ViewDataDictionary is of type 'System.Collections.Generic.List1[CoreApp2.Models.Officer]', but this ViewDataDictionary instance requires a model item of type 'System....
1
vote
1
answer
28
views
How to load ASP.NET Core Identity users with roles in one database call
We have a method to load all ASP.NET Core Identity users
await _userManager.Users.ToListAsync()
And we also have a method to load roles of a particular identity user:
IList<string> userRoles = ...
1
vote
1
answer
43
views
Referencing a C# parameter name in an attribute, working on Windows, not on Linux
I am having an issue when running a pipeline to build for a .Net 6 Web API project. I have code that looks like this:
[HttpGet]
[MyAttribute(nameof(parameterName))]
public async Task<IActionResult&...
1
vote
0
answers
58
views
How to use HttpClient in a Razor component?
I want to create a Blazor component library for my Microservice app and I have an issue on the login.razor component :
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient
@inject ...
0
votes
0
answers
22
views
C# DotNet 6.0 Library for Linux or Raspberry Pi4 getting the error "UsbDevice' does not contain a definition for 'OpenUsbDevice'"
I have a small device currently that can be communicated with windows platform with Dot Net C# (HID) based application. I wanted it to communicate with Linux or Raspberry Pi4 device using usb. I have ...
0
votes
0
answers
22
views
Microservice Portal restarted after executing my endpoint
I have an endpoint that is used to generate invoices. Essentially, this endpoint first retrieves the invoice data from the database. After certain validation, it generates the invoice in the ...
0
votes
1
answer
32
views
Ajax from DataTable is not working in .net 6
I dont get any errors in the console. And the breakpoint in the method of the controller is never called. (sorry for my bad english). The problem is that the method is never called from the ajax.
...
0
votes
1
answer
60
views
My CORS with .Net 6 and Angular application work in local but dont work in IIS
I spent 2 days to try to get CORS working with my Angular in Front and .Net 6 Core in back, and I cry...
I created a simple angular application. Juste a "get" that hit my backend API.
In my ...
2
votes
1
answer
59
views
C# System.Commandline: How do I add an argument to a command so that I can pass a value to it?
The following simple Program.cs expects a single argument for a defined root command:
using System.CommandLine;
var inputArgument = new Argument<string>(
name: "--input",
...
0
votes
1
answer
57
views
How to deploy a SignalR application on IIS
I have a simple signalR application (hub is "/myNotifyHub") for sending notifications between clients. Language c#, .net 6.0 core. There are numerous examples out there for the same. But ...
0
votes
0
answers
27
views
How to publish a net cross platform application without rebuilding it and without restoring it? [closed]
Let's say I have simple Hello World cross platform app which I need to work on both win7-x64 and linux-x64.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<...
0
votes
2
answers
67
views
Moving a custom ViewCell renderer from Xamarin to MAUI
In XAMARIN FORMS I used a custom renderer to change the background color of a selected item in a ListView and the default background color, but I was having a hard time modifying my app in MAUI to ...
0
votes
0
answers
34
views
Using ASP.NET Core 6 having issue to connect to Oracle database using TCPS protocol
After upgraded my application from .NET Framework to ASP.NET Core 6, I am having issues connecting to an Oracle database using TCPS protocol, while existing application is working fine.
I get this ...
1
vote
1
answer
97
views
How does Visual Studio picks up the current framework?
I started with a net6.0 project. And decided to provide netstandard2.0 as internal nuget output for the older supported builds.
Replaced <TargetFramework>net6.0</TargetFramework> with <...
0
votes
1
answer
36
views
AWS C# Lambda Returns Empty Array For Object
I'm trying to POST a json object through postman and trying to get my lambda function to read it. Instead of returning the property value, it's returning an empty array.
Below is my simple lambda code....
-1
votes
0
answers
37
views
ASP.NET Core 6 Web API : adding port to all requests
I created an ASP.NET Core 6 Web API on IIS. I don't use any port in my code. But API adding port to target urls for example Sentry Client. Because of that my requests from my API not working correctly....
0
votes
1
answer
78
views
.Net 6 Azure Functions project - include Azure.Worker.FunctionAttribute and Azure.WebJobs.FunctionNameAttribute in same project
I'm working on an existing Azure Functions project that contains Microsoft.Azure.Functions.Worker.FunctionAttribute functions.
For example:
using Microsoft.Azure.Functions.Worker;
[Function("...
0
votes
1
answer
15
views
InvalidOperationException: Service Not Registered in ASP.NET Core Worker Service
I'm working on an ASP.NET Core application with a BackgroundService where I'm facing an issue with dependency injection. I've set up a generic repository pattern and have registered my services in ...
0
votes
1
answer
67
views
Blazor Server Azure App Service Easy Auth
I have a .Net 6.0 Blazor Server app running in an Azure App Service. Azure gives you the ability to setup your App Service so that it does the authentication for you. This is called Easy Auth. You can ...
0
votes
1
answer
30
views
Problems implementing antiforgery token in Angular 15 with NET 6 API
I already went through a lot of posts here on how to do this but nothing that works so far.
I used this piece of code in my startup.cs:
public IServiceProvider ConfigureServices(IServiceCollection ...
0
votes
1
answer
118
views
dotnet6 on Azure WebApp - http error 413 request entity too large
I'm getting the following error while uploading large (38 MB) file using file upload on .NET 6 application deployed on Azure using Chrome browser:
I googled and found 2 solutions. It works fine in my ...
0
votes
1
answer
49
views
How to show a message if selected language is not valid
I have a drop-down list to select languages and it works. My question is if a language is selected and doesn't have any information in the database.
How do I show a message, saying "No officer ...
0
votes
0
answers
9
views
Create an Online Meeting Event in Microsoft Teams Using the Graph API
We have a need to integrate Microsoft Teams with our application for scheduling online meetings. We are currently utilizing the API sample provided in the second example, and the process is successful....
0
votes
1
answer
40
views
blazor wasm deployment - Where is the run time of .net 6.0 copied to the folder when it is publised as self contained azure app service
This is my blazor publish (wasm+hosted) properties, I am deploying it as a self contained application which I am assuming means the .net run time 6.0 also will be packaged to it. Now I deploy it to ...
0
votes
1
answer
74
views
Advice on Integration Testing for Azure CI/CD [closed]
API Project built using .Net 6
Currently writing unit tests for our API project.
I have just implemented Moq framework and used the Setup() function to test for exceptions
My question is, we will be ...
0
votes
0
answers
13
views
Visual Studio 2022 + .NET Upgrade Assistant - Cant Import Controls After Conversion From .NET Framework
We are in the process of trying to salvage an old package for current use in a WinForms application being converted from .NET Framework to .NET 6+ using the .NET Upgrade Assistant
This package was an ...
0
votes
0
answers
6
views
AspNetCoreGeneratedDocument - On build server this doesnt get included in the DLL
With .Net 6, razor views are compiledinto the main DLL, under the namespace AspNetCoreGeneratedDocument. I have a solution where this works perfectly well locally, but when building from Jenkins, ...
1
vote
1
answer
66
views
Consume service bus message after x time
I'm doing a project to study more of brokers and i'm using .NET 6.0 and Service bus to do this.
My question is: I need to publish a message and consume the same message only after a few time (i put ...
1
vote
0
answers
52
views
How to use Kiota MultiPart with IFormFileCollection
I am using Kiota to generate an HTTP client within a shared project among multiple solutions. Everything is functioning as expected, except for one specific use case related to a POST resource. The ...
0
votes
1
answer
43
views
NLogConfigurationException: Error loading extensions: NLog.Extended
I am following this post to configure NLog to write to a text file in my .Net 6.0 Web api project
https://medium.com/projectwt/nlog-with-ilogger-in-net-6-0-web-api-fb7072d8ac6c
But when I run the ...
0
votes
1
answer
53
views
Microsoft.Data.SqlClient.SqlException: 'The text and text data types are incompatible in the equals operator.' .net 6.0
I have a SQL Server Express database with this table schema:
CREATE TABLE IF NOT EXISTS "MovieGenreExcel"
(
"title" TEXT,
"year" INTEGER,
"summary" ...
0
votes
0
answers
34
views
Refit.ApiException at System.Text.Json.Serialization.JsonCollectionConverter
I am using Refit to call APIs in .NET 7.0
System.Text.Json.Serialization.JsonCollectionConverter throws exception when the response returned in empty.
It works fine when result contains data.
I think ...
0
votes
1
answer
41
views
How to let windows to restart a .net service on failure
I am writing a windows service. Unfortunately, I am forced to use a library with a bug. When this bug appears I cannot get rid of it by other means than restarting the process. It is not enough to ...
-1
votes
1
answer
34
views
"InvalidOperationException:" While trying to save a many to many relationship to database
First of all, i just wanna say i'm a total newbie with asp .net core mvc, and entity framework, soo i don't really know if i'm doing this right or in the best way.
I'm trying to do a simple program ...
0
votes
0
answers
41
views
Integrating Internal Identity Provider (PingID) with ASP.NET Core Identity Server and Angular App
I have a system architecture comprising three applications: a web API developed in ASP.NET Core, an Identity Server, and an Angular app as the UI. The Identity Server is implemented using ASP.NET Core ...
0
votes
1
answer
56
views
ASP.NET MVC view won't update after model changes
The Radiologists view loads just fine first time you enter, and the dropdown is filled with data.
After you select a doctor, the table should display the two values shown in the view, but they won't ...
0
votes
1
answer
68
views
Unexpected behavior of IEnumerable<T> in C# [duplicate]
I found some unexpected behavior in .NET 6. Could somebody please explain it to me?
Consider the following code:
public class A
{
public string Name { get; set; }
public double? Value { get; ...
1
vote
1
answer
47
views
Blazor Web Assembly No line error on Azure Static Web App
I am working on a Blazor WebAssembly application .Net 6 and have encountered a peculiar behavior regarding the display of exception details. While in my local development environment, I can see ...
0
votes
1
answer
74
views
How to pass Microsoft Extenstion logger from ConfigureServices of Start up class to a static extension method in .NET 6
This is my code in .NET 6. If I do this I am getting this error
Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger`1[xxx]' while attempting to activate 'xxx.Startup'.
How to ...
0
votes
0
answers
27
views
How to change SpaProxyLaunchCommand in .net 6 spa project at runtime?
I am trying to switch the angular config of my .net 6 spa app at runtime by passing an argument to the "npm start" command. For me to do that I need to change the "SpaProxyLaunchCommand&...
0
votes
0
answers
8
views
HotChocolate and UseExceptionHandler middleware
I have a .Net 6 web application which exposes a GraphQL Api for which I am using HotChocolate v13.
I know HotChocolate handles exceptions during query execution and we have implemented an ErrorFilter ...
1
vote
1
answer
47
views
Azure Blobtrigger function - InvalidResourceName
In Azure, I'm setting up an Azure Function with a blobtrigger, it uses a SAS connectionstring to a blobstorage account in the same subscription, in the same resource group. When starting the function, ...
0
votes
1
answer
79
views
500 Error: Internal Server Error with aPI deployed on Azure with swaggwer
I deployed my API on Azure but I get a 500 error with no message! How could I solve this issue? This is my Program.cs:
var builder = WebApplication.CreateBuilder(args);
// Add services to the ...
0
votes
1
answer
52
views
Entity Framework Core Contains doesn't seem select the data I need
So I have this query that I had to use in our backend (.NET 6, Entity Framework Core 7.0.5)
SELECT
(SELECT COUNT(*)
FROM BulletinLinks BL
INNER JOIN Bulletins B ON BL.BulletinID = B....