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
.net-6.0
5,911
questions
0
votes
0
answers
11
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 ...
0
votes
0
answers
20
views
WebOptimizer cache busting not working on Azure
I am using ASP.NET Core Web Optimizer. It has cache busting feature that will append a unique string to the end of script or CSS links.
A sample of the appended string is like this: ....script.js?v=...
1
vote
1
answer
34
views
How to insert a custom object into an User using foreign key
I'm currently having problem with displaying a custom object property because the program doesn't seem to insert the associated value from the table with appropriate foreign key.
Here are the codes
...
1
vote
1
answer
45
views
Rebuild skip all project in Visual Studio 2022
I do not understand why Visual Studio skips all the projects to do rebuild of the solution.
The output console only shows that the projects were skipped.
I have tried deleting the bin, obj and .vs ...
0
votes
1
answer
34
views
How to use razor renderer in .NET 6?
In my .NET 4.8 Web API application, I take an externally received HTML formatted string and convert it to a .cshtml file using Razor Engine, then append it to my page with JavaScript. I do this using ...
0
votes
2
answers
83
views
Need help to replace a switch in C#
I have a console application in .NET 6 that receives one argument, and based on that, has to decide which operation will be executed. At first, I had all the operations as static methods and ...
0
votes
2
answers
43
views
How to use Enumerable.Aggregate without getting CS0411 error
There are two DTO records:
public record struct DateHour(int Hour, double? Value);
private record struct HourSnapshot(uint TotalSeconds, double? Value);
I have another method which works with enum. I ...
0
votes
0
answers
45
views
Found multiple publish output files with the same relative path. while publising ASP.NET Core 6 project
In .NET Core 6 where when publishing with Web Deploy via Visual Studio 2022, I get the following error:
Error: found multiple publish output files with the same relative path:
There is no issues ...
0
votes
1
answer
20
views
AppKit.NsWindow error on .NetMAC OS application after migration from Xamarin.MAC
I have Xamarin.MAC native application built with C# language. Since the Xamarin support is stopped, I have to migrate it to .Net MAC OS. But I am not seeing the AppKit.Window in the .Net MAC OS. In ...
1
vote
1
answer
54
views
Is it possible to use ProtectedLocalStorage without regular .NET Core?
Seems like an obvious upgrade from regular localstorage, but I've only seen it used with Blazor.
I'm using ASP.NET Core 6.0 MVC.
Should I just put this in my program.cs?
builder.Services.AddScoped<...
0
votes
0
answers
49
views
ASP.NET Core 6.0 Web API : cannot context switch to another account to start an executable
I have an ASP.NET Core 6.0 Web API that runs on IIS 7. The application pool is running under an account local to the machine but not the local system, call it 'local-system-web-account'. I am trying ...
1
vote
1
answer
43
views
Unexpected System.BadImageFormatException: Index not found That is Fixed with Restart
I have an ASP.NET Core 6 MVC web application hosted on IIS that all of a sudden started throwing the following exception:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of ...
-1
votes
1
answer
52
views
EntityFramework pretends to have updated a row but it doesn't
I wrote an InsertOrUpdate() method which uses my EntityFramework dbcontext and I want the method to be able to receive an object and then either insert a new row or update an existing one if it exists ...
0
votes
0
answers
30
views
.Net 8 Project Reference Specify .net Version of Multi-Targeted Transitive Project Dependency
I have a .net6 sdk project that I need to upgrade to .net8 for some new functionality. It has some shared project libraries with other projects that are still .net6.
Project A includes Project B which ...
0
votes
0
answers
22
views
How to Display Dictionary<string, string> Properly in Swagger UI using NSwag
I am using NSwag to generate Swagger documentation for my API. One of my API endpoints uses a Dictionary<string, string>, but in the Swagger UI, it is displayed as a generic object. Instead of a ...