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,916
questions
3
votes
2
answers
2k
views
Policy Authorization in Azure Functions .net 6
I'm attempting to migrate from a REST API that I developed in a Web App to Azure Functions. In the Web App I use the "Authorize" attribute decoration with a Policy like:
[Authorize(Policy = ...
0
votes
1
answer
30
views
Unable to send a local image that isn't under wwwroot to openai using its new .NET library
I have an ASP.NET Core 6 Web API with the new official library from OpenAI (https://github.com/openai/openai-dotnet).
What I'm trying to do, is to use a local image file to OpenAI. The file isn't ...
280
votes
16
answers
253k
views
Non-nullable property must contain a non-null value when exiting constructor. Consider declaring the property as nullable
I have a simple class like this.
public class Greeting
{
public string From { get; set; }
public string To { get; set; }
public string Message { get; set; }
}
Strangely I get the ...
0
votes
0
answers
26
views
Any pitfalls in upgrading a WPF application from .Net 6 to .Net 8?
We're looking to upgrade some large WPF solutions from .Net 6 to 8, and my understanding is that the process should be straightforward (changing the projects' target framework). But are there any ...
0
votes
0
answers
42
views
Populate a many to one relationship and how to show data input only once but increment if the date in the input are the same
I am currently working on a web project that required user to input a group of value for each person in a department per day then display it in two other index for day and month. I'm having problems ...
0
votes
0
answers
271
views
Replacement for Microsoft.Practices.EnterpriseLibrary.Validation in .Net 6
I'm converting an old application from .Net 4x to .Net 6, and I can't seem to find a replacement for Microsoft.Practices.EnterpriseLibrary.Validation. In newer code we've used System.ComponentModel....
-1
votes
1
answer
46
views
C# WPF Change Text Event From TextBox
i have a problem. I made a new class called "LetterBox" this class inherits from TextBox everything is working for now. But here comes the problem: I need the Event or Function that "...
46
votes
6
answers
33k
views
How to fix Visual Studio 2022 Warning CA1416 "Call site reachable by all platforms" but "only supported on: 'windows'"?
So I have a C# class library project that I only intend to use on Windows. It contains some classes that use the System.Drawing.Image class which is only available on Windows. After upgrading to ...
0
votes
3
answers
84
views
How to let HostedService run after host started?
I have a .NET 6 console app.
Program.cs code:
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Threading;
using ...
0
votes
1
answer
29
views
Can't load System.Net.WebHeaderCollection
.net 6.0 project, it throw the exception can't find a dll version 6.
this is the error:
System.AggregateException: One or more errors occurred. (Could not load file or assembly 'System.Net....
0
votes
0
answers
20
views
AsyncWebserver_Teensy returns invalid status line
Problem
My teensy is connected to 4 Serial devices and I use the Webserver provide access to them over a local network. I have a Raspberry Pi that is requesting data from the Webserver in multiple ...
0
votes
2
answers
1k
views
How to properly save a complex object using EF Core
I have a problem with saving a complex object...
The (simplified) objects look like this:
public class Excavator
{
public int Id { get; set; }
public ExcavatorType Type { get; set;...
5
votes
2
answers
5k
views
.NET 6 to SQL Server error, Pre-login handshake failed - [Pre-Login] initialization=21001;
This is not a duplicate of A connection was successfully established with the server, but then an error occurred during the pre-login handshake . I have two applications, one built on .NET Framework 4....
38
votes
2
answers
6k
views
FileVersionInfo.ProductVersion suddenly contains git commit hash
I have a .NET 6 WPF project and cannot figure out what changed as the ProductVersion of my assembly suddenly contains a git commit hash.
My project file always looked like this, where I also updated ...
8
votes
1
answer
3k
views
How to host blazor webassembly app with different base path
I have a Blazor Webassembly, .NET hosted application. On the server we host it on, the base path of the app will be mydomain.com/coolapp. Therefore, to try to get the app to render correctly on the ...