100 questions from the last 7 days
0
votes
0
answers
12
views
OpenApi 3.1 and AddOpenApi in AspNetCore application Int32 vs. String
Well, I'm somewhat stuck here and I don't know which side is doing things it's not supposed to do. I'll try to outline the issue first.
I have an API call which is defined like this:
[HttpGet("...
1
vote
0
answers
39
views
Required data annotations returning namespace rather than error message value?
I have an ASP.NET Core 8 MVC application, using the bog standard [Required] attribute on a class property. I expected to see the defined error message in my HTML, in the data-val-required attribute on ...
0
votes
0
answers
61
views
.NET is not recognized
In a .NET Core C# project, I get many errors like this:
Predefined type 'System.Object' is not defined or imported
Primary variables such as int and string are not recognized.
I have tried the ...
0
votes
0
answers
72
views
Async void function returns immediately when making POST request [duplicate]
I'm trying to send a POST request using Newtonsoft.Json and HttpClient in C# and I've been using Postman to test out the JSON.
As soon as I send the post, it immediately exits the CreateQuotePost ...
Advice
1
vote
2
replies
49
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 ...
0
votes
2
answers
68
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 ...
0
votes
1
answer
41
views
editorconfig rule to enforce that namespace is set in all C# files
I want to set a rule in .editorconfig so that all C# files where namespace is not explicitly set should render an error.
I've added these:
dotnet_diagnostic.IDE0130.severity = error # Namespace does ...
0
votes
2
answers
61
views
MRU structure with fixed number of elements, automatically adapting to LINQ queries
I have a folder containing huge numbers of files in many subfolders, and I want to select the files with a name that matches any of a specified list of patterns (regular expressions). My regular ...
Best practices
0
votes
4
replies
62
views
Upgrading from .NET framework 4.8 VB.NET project to .NET 10
I have an application which was written years ago in VB.NET. Recently I migrated it to .NET framework 4.8. This change was smooth.
Now I am planning to migrate it to an ASP.NET Core 10 Web API using C#...
0
votes
0
answers
20
views
MediatR Nuget package versions creating problems
I am getting a version mismatch error when using MediatR in my .NET project.
What happened:
Yesterday my project worked correctly with no errors.
Today I updated some NuGet packages by mistake.
After ...
0
votes
0
answers
51
views
VS Code doesn't Recognize Unity Classes
For two days now, I've been having a rather strange problem.
The MonoBehaviour class isn't recognized by VS Code, with the following error:
Error while loading [...]: Exception thrown: System....
-3
votes
0
answers
26
views
D365 C# Plugin sporadically stop processing [closed]
I have created a C# plugin that has a method that runs AfterInsert of record. The issue I am running into is it sporadically inserting a record into the sharepointdocumentlocation table/entity. There ...
-1
votes
0
answers
48
views
Why can PropertyColumns not infer their type parameters when passed to a wrapper? [duplicate]
I am using MudBlazor's MudDataGrid, which functions very similarly to Blazor's QuickGrid. The grid's contents are determined by a RenderFragment parameter called Columns, which contains a list of ...
Advice
0
votes
0
replies
30
views
Refactoring Azure Functions .dll files to external project makes it fail for durable functions, why
I have build my project using Azure Functions, my project has core projections which hold core projects
so I have
MyProject.Core
<PackageReference Include="Microsoft.Azure.Functions.Worker&...
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 ...
Tooling
0
votes
1
replies
41
views
How to programmatically insert Plant 3D catalog parts into a drawing using C# API?
I’m working on automating the insertion of parts from a custom Plant 3D catalog into project drawings using a C# plugin.
What I have so far:
A custom catalog (.pspx, .acat, .pspc) with supports and ...
-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 ...
Advice
1
vote
3
replies
97
views
C# advanced features - Book?
I would like to learn new C# features. There are many books that introduce basic C# features. Are there any that cover advanced,new, features?
Best practices
0
votes
3
replies
67
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
├── ...
Best practices
1
vote
1
replies
50
views
Using Spectre.Console.Cli with Generic Host
I have a CLI app in .NET, built with Spectre.Console.Cli package. I use ServiceCollection with Spectre ITypeResolver and ITypeRegistrar interfaces to wire up the DI. That works great, but now I want ...
-2
votes
0
answers
61
views
Cannot set control height or width [closed]
I am working with Microsoft Visual Studio Professional 2022, C#. Using System.Windows.Forms I have a dialog with an instance of TableLayoutPanel, in the table I am creating a Label following by a ...
0
votes
1
answer
81
views
How to have a repository-type table without FKs?
Is it possible to have a type in Entity Framework Core that doesn't create FKs to every other table that uses it? Creating the DB-Scheme from the C#-model with Add-Migration and Update-Database.
For ...
6
votes
1
answer
191
views
Difference between Expression.Return and Expression.Goto in C# Expression Trees
I'm experimenting with C# Expression Trees and trying to understand the difference between Expression.Return and Expression.Goto. I can’t create an example where Return and Goto behave differently ...
Tooling
0
votes
3
replies
75
views
c# windows form passport size photo image background change
Any samples for C# Windows Forms passport size photo image background changer.
Bitmap bitmap
for (int y = 0; y < bitmap.Height; y++)
{
for (int x = 0; x < bitmap.Width; x++)
{
...
5
votes
6
answers
173
views
DistinctBy, but preserve the last element of each group of duplicates
I have a list of items that contains duplicates, and I want to keep the last item of each group of duplicates. The native DistinctBy LINQ operator keeps the first item from each group, so it doesn't ...