Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
0 answers
29 views

ASP.NET Core 6 Web API : password popup on new server

We are moving to a new Windows Server 2022 and when using Swagger, some users are experiencing a popup window asking for username and password when trying to run an operation. Others are able to run ...
Webbert's user avatar
  • 63
1 vote
1 answer
37 views

Why does my ASP.NET Core MVC application add some identifier to HTML elements?

When running my new ASP.NET Core MVC application and viewing it in the browser, it seems ASP.NET Core added some kind of ID to some HTML elements. I'm using .NET 6, and Razor .cshtml pages. Why? And ...
Vincent's user avatar
  • 2,093
0 votes
0 answers
54 views

Multiple select dropdown list ASP.NET Core 6

When I create a post, I need a multi-select dropdown field, so I can select more than 1 category for 1 post. I have created those entities: Post, Category, PostCategory Do I need this PostCategory ...
Anna James's user avatar
4 votes
2 answers
1k views

Unexpected requirement of "Microsoft.WindowsDesktop.App" in ASP.NET Core app

Recent changes in my Visual Studio solution for an ASP.NET Core (.NET 6.0) API application have resulted in a requirement for "Microsoft.WindowsDesktop.App", with the framework entry being ...
obfusc8d's user avatar
0 votes
1 answer
114 views

How to inject ILogger<Startup> in .NET 6

Recently we moved from .NET 2 to .NET 6. I want to keep using startup.cs file. So I refactored program.cs and startup.cs files as below Program.cs Log.Logger = new LoggerConfiguration() ....
LP13's user avatar
  • 33.2k
1 vote
1 answer
212 views

Require instant MFA for specific Action in ASP.NET Core 6

I'm using ASP.NET Core 6. The app is configured to consume Azure AD authentication with MFA: builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme) ....
Norman's user avatar
  • 3,429
0 votes
1 answer
86 views

Where can I add a logging scope for permission requirements without repeating myself?

In .NET 6, I have added an authorization policy that ensures users have access to a certain set of resources. Now I want to log the ID of the set of resources as well as the User ID to show which user ...
Ben Zuill-Smith's user avatar
0 votes
1 answer
391 views

Run ASP.NET Core 6 MVC app with attribute route

I have an ASP.NET Core 6 MVC application and when I run my app, I get a http 404 error: Index action method: public class HomeController : Controller { [HttpGet] [Route("/User/Dashboard&...
tachafine ammel's user avatar
0 votes
1 answer
400 views

.Net Core 6 - IIS worker process crashes and needs IIS app restart

.NET version: .NET Core 6 Server: Windows Server 2019 IIS: 10 I've an ASP.NET Core 6 MVC app which crashes randomly (the application fails to respond) and needs an IIS app restart. Event viewer error ...
Kannan M's user avatar
  • 570
2 votes
1 answer
346 views

ASP.NET Core: get section of appsettings.json as immutable record

Is there a clean way to read in a section of appsettings.json as an immutable record? For example, if my appsettings.json looks like this: { "MySection": { "Id": 5, "...
MLavrentyev's user avatar
  • 1,949
0 votes
0 answers
87 views

Get Product API and Facing this error on swagger, Error: response status is 401

**Requested URL :** https://localhost:7028/api/Products?Authorization=bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjBERTk0RjhGQzBBRkM4RkIxMUYyQzFDMEE4QTRCNzdGIiwidHlwIjoiYXQrand0In0....
Muzammil's user avatar
2 votes
1 answer
307 views

Is it possible to return a 404 from ASP.NET Core 6 MVC middleware

I have an ASP.NET Core 6 MVC application with both view-based controllers and API controllers. I'd like to be able to disable certain controllers through configuration, and I have a middleware that ...
Greg Graham's user avatar
1 vote
1 answer
857 views

Localization doesn't work in .NET Core 6.0

I try to use ViewLocalizer in my ASP.NET Core 6 MVC project. But when I run the project I couldn't see any translation from my resources folder. Here is my program.cs code: builder.Services....
Kamer's user avatar
  • 11
-2 votes
1 answer
498 views

How to connect appsettings.json with IConfiguration on worker service c#

I was creating a background service and I keep the database connection sentence on the appsettings.json file, which I need to access through program.cs. I am using .Net 6 version. How can I access it ...
Berat's user avatar
  • 23
2 votes
1 answer
3k views

Microsoft.AspNetCore.Razor replacement?

On the MS website itself they advice to use the Microsoft.AspNetCore.Razor namespace for building custom tags: https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/authoring?view=...
nickornotto's user avatar
  • 2,086

15 30 50 per page
1
2 3 4 5 6