95 questions from the last 30 days
12
votes
4
answers
3k
views
installing dotnet-ef dotnet tool throws error
I’m trying to install the Entity Framework Core CLI tools globally using the .NET CLI command:
dotnet tool install --global dotnet-ef
However, the installation fails with the following error message:
...
4
votes
1
answer
92
views
Deserialization of XML with multiple namespaces
I'm attempting to deserialize an XML response from an API. The data is as follows (I have only included a small chunk for the sake of a small post):
<ns1:alerts xmlns:ns1="http://gov.fema....
Best practices
3
votes
3
replies
87
views
C# CancellationToken across chain of api calls
I have the following application architecture:
FrontEnd → ApiServer 1 → ApiServer 2 → Database
So, the frontend calls a web server, which calls multiple API which make query on database.
What is the ...
2
votes
2
answers
130
views
Getting syntax highlighting on string argument
I am currently creating a custom .NET router.
It is working as it should, but one thing that bothers me is that I don't get the same level of syntax highlight in rider as I get with other more ...
2
votes
1
answer
87
views
Replace strings in files when using a .NET item template
I am creating my first template for a .NET solution. For the most part it works, but I have a string "MyService" at some places in the Program.cs that I would like to replace with "...
2
votes
1
answer
146
views
How do I use .NET reflection to emit generic interfaces and a class which implements them
I am trying to use .NET reflection to emit a class and some interfaces which the class implements. However, I cannot seem to correctly implement the interfaces that are generic, as that results in ...
2
votes
0
answers
41
views
WKWebView PDF background turns gray in iOS 26 — how to restore white background?
We’re encountering an issue with WKWebView on the latest iOS 26 beta. When loading a PDF URL, the background behind the PDF now appears as dark gray, instead of the expected white.
Environment:
Device/...
2
votes
1
answer
83
views
System cache constantly grows when stress testing backend app
I've been stress testing my .NET application that uses PostgreSQL to find memory leaks. The app is very stable memory-wise — memory usage only depends on the number of concurrent connections.
However, ...
2
votes
0
answers
38
views
Dotfuscator Community Edition doesn't find last runtimes
If I run free Dotfuscator shipped with VS 20222 with Check flags enabled I get this error message:
Could not find a runtime-compatible version of the validity period checker library for all input ...
Advice
1
vote
4
replies
141
views
Will This C# Generic Method Handle Async Properly?
I have some C# code (in a .NET Standard 2.0 library) that looks like the following:
private object MySynchronousOp(object param, object cmnParam)
{
//Do stuff...
return theObject;
}
private ...
Best practices
1
vote
5
replies
82
views
Handling mutable models in MVVM
In an MVVM architecture, models should be kept free of UI-related logic. They represent pure data that is retrieved from memory via a service. I see a challenge when the user interface needs to ...
1
vote
1
answer
69
views
asp.net tilde ~ paths not resolving on pages with a master page
I have a page Product.aspx that has a master page Main.master, both pages are in the root of the project (they don't belong to any folder). The problem is that the tilde path only works for the Main....
1
vote
2
answers
59
views
Format Currency for given culture and currency ISO code
I want to format a number with a given culture and a given currency ISO Code. I was not aware that besides the position and number format also the currency symbol changes based on culture.
That's what ...
1
vote
0
answers
22
views
Problem with Roslyn configuration on neovim
I've been trying to setup roslyn.nvim with rzls.nvim on my neovim for a while to work with .NET, C# and Blazor. But I've been facing some frustrating problems, I'm using WSL Ubuntu 24.04, a neovim ...
1
vote
1
answer
45
views
TSC TE210 Printing extra label when print executed by application
I want to print data on a label.
I created a ZPL template file and in my application i read that template file, look up a specific string, replace that string with data from my application and then ...
1
vote
0
answers
48
views
I start integration tests with `dotnet test`. They spawn IIS Express which fails ONLY on CI pipeline if I require code coverage
The test with coverage runs perfectly well locally:
C:\xyz\DevOps\xyz.DependencyInjection [master ≡]> dotnet test -c:Release --no-build -f net9.0 --filter "FullyQualifiedName~Tests....
Best practices
1
vote
3
replies
65
views
.NET - Messaging - Where to place shared contracts
I have a question about sharing contracts between services using a message broker (more specifically, Azure Service Bus). I searched for it in various articles and asked a chatbot, but I didn't get a ...
1
vote
0
answers
68
views
System.Net.WebSockets is missing messages/notifications
I am creating a lib to listen to server notifications (more than 100,000 requests per hour), when using WebSocketSharp it is receiving all 100,000 notifications but there is memory leak (server goes ...
1
vote
0
answers
258
views
iOS 26 and .NET MAUI 9 - Flyout Hamburger Icon and Back button color being overwritten by iOS appearance
I have a .NET MAUI Shell application with a Flyout menu targeting .NET 9. The Action Bar in both Light and Dark mode is set to be black. I want the hamburger menu icon and the back button to be white ...
1
vote
1
answer
80
views
Preventing timeout when debugging (stepping through the code) in .NET Azure Function apps
I have a number of HTTP triggered Azure Function apps that do not time out when in production. However, when I want to debug them by stepping through the code (in Visual Studio 2022), slowly and ...
Best practices
0
votes
3
replies
65
views
Can a Composite Component class inherit from another abstract base class without breaking the Composite pattern?
I’m studying and implementing the Composite design pattern in C# for a university project.
In most textbook examples (GoF, Refactoring.Guru, etc.) the class hierarchy looks like this:
Component
├── ...
0
votes
2
answers
108
views
Is it possible to use generic argument of a type for its attribute parameter (JsonConverter)?
Use case: I want to write a JsonConverter for a generic type like this, but I cannot apply it to the type itself:
public class EditingModelConverter<T> : JsonConverter<EditingModel<T>&...
0
votes
1
answer
127
views
SQL CLR function bad performance comparing to .NET App
In our system we are hashing passwords with the following method.
public static string HashPassword(string password, byte[] salt)
{
if (salt == null)
{
throw new ArgumentNullException($...
0
votes
1
answer
104
views
Changing the version of an assembly reference is not allowed during debugging
I get this error:
Failed to emit module 'xyz': Changing the version of an assembly reference is not allowed during debugging: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=...
0
votes
2
answers
64
views
C# project with a package reference to a nuget with an exe assembly
I know that in the early times of .NET Framework, you could build an assembly into EXE and then use that "EXE assembly" as a dependency of another .NET Framework assembly which, too, could ...