340,756 questions
Advice
1
vote
2
replies
48
views
Dynamic Forms in ADO.NET
I am a newbie in .NET - can someone tell me about dynamic forms? I have done master detail and simple crud - should I go for dynamic form r practice more in master details. I want to know about ...
9
votes
5
answers
6k
views
How to Add JWT Token Support Globally in Scalar for a .NET 9 Application?
I'm working on enabling Scalar in my .NET 9 application and need to configure it to use JWT tokens globally, similar to how Swagger allows adding JWT token authentication globally. However, I couldn't ...
0
votes
1
answer
876
views
How do I solve the exception of missing dll? The dll file is in the directory
This line:
Boolean bl = InitializeDirectX(mypb);
And the InitializeDirectX method that use DirectX:
public Boolean InitializeDirectX(PictureBox pb)
{
DispMode = Manager.Adapters[...
2
votes
1
answer
239
views
Does EF Core supports `ComplexType` under `Owned` property?
I'm using ComplexTypeAttribute for some data columns that I want to group together like:
[ComplexType]
public record TrashData(DateTime? Value)
{
public Identity By { get; init; } = Identity....
0
votes
2
answers
60
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 ...
10
votes
2
answers
7k
views
Possible memoryleak in ConcurrentBag?
I've been reading into the new concurrent collections and esspecially the ConcurrentBag got my attention. Since the ConcurrentBag internally holds a local set on each individual thread using it to ...
0
votes
0
answers
25
views
Issue with Template.Json not excluding files
I have built a template project with a Template.json and this will generate the template fine ( no errors at all )
ive also managed to add some choices to the symbols that will add or hide code ...
146
votes
9
answers
88k
views
How to make Entity Framework Data Context Readonly
I need to expose an Entity Framework Data Context to 3rd party plugins. The purpose is to allow these plugins to fetch data only and not to let them issue inserts, updates or deletes or any other ...
33
votes
9
answers
97k
views
Windows service stops automatically
I made a Window service and let it work automatically and under localsystem account, when the service starts it fires this message for me and then stops
The [service name] service on local computer ...
-1
votes
0
answers
56
views
VS Code fails to run .NET, even if I installed it
When I open a workspace in VS Code, I get this error message notification on the bottom right corner :
Failed to run .NET runtime. You may be missing key Linux libraries. Install them now?
Source: ....
0
votes
1
answer
375
views
How to make a non-modal sheet using BottomSheetDialog in .NET MAUI?
I have a method that creates a bottom sheet using BottomSheetDialog in a .NET MAUI app. The code looks something like this:
public static BottomSheetDialog ShowBottomSheet(this Page page, IView ...
3
votes
1
answer
12k
views
Project '..' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.7.2'
I created my initial project that targets Framework version v4.7.2. I needed to add a class library in my project using visual studio 2022 Community. While doing so, VS2022 gave me only 4 options to ...
0
votes
1
answer
690
views
AWS S3 PreSignedUrl Upload Error
I'm trying to upload files to S3 storage using the .Net SDK, and am seeing the following error response when PUTing to the pre signed URL provided by AWS:
The bucket you are attempting to access must ...
0
votes
0
answers
47
views
MAUI .NET 9 Android: "Application APK file path is not found" in Rider for both Debug and Run, simulator and physical device
I'm trying to debug and run a .NET MAUI Android app targeting .NET 9 in JetBrains Rider (2025.1.3).
SDKs installed:
9.0.308 [C:\Program Files\dotnet\sdk]
10.0.100 [C:\Program Files\dotnet\sdk]
...
53
votes
9
answers
52k
views
How to convert an expression tree to a partial SQL query?
When EF or LINQ to SQL runs a query, it:
Builds an expression tree from the code,
Converts the expression tree into an SQL query,
Executes the query, gets the raw results from the database and ...
0
votes
3
answers
9k
views
"IOException: There is not enough space on the disk." while there is enough space
I made sequence of operations (on local disk):
Copy file to ###.bak
Save file to ###
Delete file ###.bak
Code:
File.Copy(filename, filename + ".bak");
TextWriter writer = new StreamWriter(filename);...
0
votes
0
answers
19
views
Revit 2024 API: Family cannot be loaded from fixed file path (Truss Hole Add-in)
I'm building a Revit 2024 add-in that places a circular void hole where the user clicks in the model.
The hole family has a “Diameter” parameter and cuts only structural framing members around the ...
12
votes
1
answer
13k
views
one of the parameters of a binary operator must be the containing type c#
public static int[,] operator *(int[,] arr1, int[,] arr2)
{
int sum;
int[,] res = new int[arr1.GetLength(0), arr2.GetLength(1)];
for (int i = 0; i < arr1.GetLength(0); i+...
1
vote
1
answer
44
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 ...
-7
votes
0
answers
82
views
Whenever I try to compile my MAUI project I get CS0246 Error
I'm trying to build a three piece Streaming Project in which I need to build an API that is already working, a Java App for Android that I haven't even started and this .NET MAUI using C# that is ...
Best practices
0
votes
3
replies
62
views
Apply [ApiController] to all controllers implicitly
Adding [ApiController] on a controller class has various benefits. Especially the automatic model validation and problem details parts.
The problem with this attribute is that it's easy to forget to ...
0
votes
2
answers
222
views
Ef Core Migration Commands Do Not Work In WinUI3 Project. Error is WindowsAppSDKSelfContained requires a supported Windows architecture
I'm working on a WinUI3 application. I created the project using Template Studio and modified the project files to get is working with dotnet 9. Everything was going smooth until I needed to ...
0
votes
0
answers
35
views
Can a .NET project template automatically add a project reference to an existing project in the solution when added from Visual Studio?
I have a system where users create .NET plugin libraries. To support this, I’ve built:
A solution template that creates:
a plugin project
a testbed console app
a project reference from the testbed → ...
55
votes
4
answers
41k
views
What is the difference between UseHttpsRedirection and UseHsts
I don't quite get the difference between UseHsts and UseHttpsRedirection in the configure section of the startup file in .net core. Could anyone explain?
0
votes
0
answers
26
views
IL2026/IL3050 Warnings only visible via dotnet format, neither in Visual Studio 2026 nor via dotnet build /publish
After installing Visual Studio 2026 and .NET10 I noticed the following behavior:
I’m building an AOT project that uses DI. When I build and publish the project, the IL trimming/AOT warnings are not ...