Relative Content

Tag Archive for c#.net

Configuration not loaded from environment variables

I have some values for the application configuration in appsettings.json file and some values in environment variables. I expect the configuration key values to be populated with the values from the environment variable, but it is just empty. Can you please help me?

How to Structure Project

Just learning .NET and compared to other stacks, the project structure is very confusing to me.

Upgrading dotnet in Visual Studio 2022 Community version

I have installed newer versions of dotnet on my Windows 11 system running Visual Studio Community 2022, but when I try to update one of my Windows Application projects from the Projects -> Options dialog the only ones that show up in the Target Framework drop down are .NET Framework 4.7.2 and 4.8. In the same drop down there is an option to install other frameworks and I have tried that. I have loaded both 6.0 and 8.0. They show up under C:Program Filesdotnet, but do not seem to be available to my project. So, is VS Community limited in some way? I tried update the .csproj file using Notepad, but VS did not like that.

Why can the inliner forget the no-optimize attribute?

I was reading on what’s new in .NET 9 and stumbled over the CrypographicOperations type which has a method called ZeroMemory used to ensure that zeroing memory is not optimized away.
(https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview#net-libraries)

Why can the inliner forget the no-optimize attribute?

I was reading on what’s new in .NET 9 and stumbled over the CrypographicOperations type which has a method called ZeroMemory used to ensure that zeroing memory is not optimized away.
(https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview#net-libraries)