Skip to main content
Filter by
Sorted by
Tagged with
9 votes
2 answers
251 views

I have two versions of helper methods for logging on ILogger. The first (classic extension methods) compiles fine; the second using extension members results in a compiler warning/error code. CS8620: ...
Christian's user avatar
  • 132
1 vote
0 answers
39 views

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 ...
user31923066's user avatar
Best practices
0 votes
4 replies
62 views

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#...
Jyothish Bhaskaran's user avatar
0 votes
0 answers
61 views

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 ...
Dadkhah's user avatar
  • 125
-1 votes
0 answers
30 views

I'm using DevWinUI's shortcut control but I'm confused on how to get the key and modifiers from it and then casting it to the proper types for RegisterHotKey. The shortcut control returns public new ...
Ryan Luu's user avatar
  • 631
Best practices
0 votes
1 replies
50 views

I am currently developing a module for an ASP.NET Core Web API that uses EF Core to talk to MySQL. The problem is I have no idea how to make EF Core fill the entityId property. Here is the example ...
Sannnekk's user avatar
  • 103
-8 votes
0 answers
95 views

I'm using C#. I have a certain number of Newtonsoft.Json.Linq.JArray, let's say A123, A124, A125, and so on. I need to create an array or something similar of this objects in a way that, if I do ...
iii's user avatar
  • 7
Advice
0 votes
2 replies
34 views

When creating integration tests for ASP.NET Core 10 web apps, we use the WebApplicationFactory<TEntryPoint> class. When a single ASP.NET Core web project is used as SUT, it's simple and it works:...
AlexB's user avatar
  • 4,684
0 votes
1 answer
41 views

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 ...
Max's user avatar
  • 757
0 votes
0 answers
25 views

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 ...
Bithellio's user avatar
5 votes
6 answers
173 views

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 ...
Theodor Zoulias's user avatar
Tooling
0 votes
1 replies
41 views

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 ...
Witzendant's user avatar
0 votes
0 answers
36 views

In my CRM 365 Plugin I have requirement to write log to Application Insight, I'm able to achieve this using ILogger and Microsoft.Xrm.Sdk.PluginTelemetry library. But I have struggled to write log ...
Theodorus Agum Gumilang's user avatar
0 votes
0 answers
20 views

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 ...
YunusTemel's user avatar
1 vote
1 answer
69 views

I have two tables Products and CustomerProduct. I need to compose an Entity Framework Core object that returns the result based on arguments of the Web API endpoint method. The method roughly works ...
pepr's user avatar
  • 21.1k
-1 votes
0 answers
48 views

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 ...
AAM111's user avatar
  • 1,247
-3 votes
0 answers
26 views

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 ...
Benny Argo's user avatar
-7 votes
0 answers
82 views

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 ...
Pedro's user avatar
  • 1
5 votes
4 answers
253 views

I have a Windows Forms application and a Form with many async void event handlers. This form can be closed by the user at any moment. After closing the form I want to delete a temporary file, and my ...
Theodor Zoulias's user avatar
-1 votes
2 answers
73 views

I need to have every invocation from the ILogger interface of a test, but I mock the ILogger interface in the class that is going to be tested, so it won't write to console and therefore the ILogger ...
FlorianD's user avatar
  • 113
-1 votes
0 answers
116 views

I have a simple C++ project which uses the CoCreateInstance to access and use some C# code (com-exposed class). The simple code looks like: // ... hr = CoCreateInstance( CLSID_rclsid, NULL, ...
Kaktus's user avatar
  • 9
0 votes
0 answers
44 views

I'm learning how the back end and front end work together by reviewing WPF (Window Presentation Foundation) code. The project runs locally on my machine. I copied it from my team's shared folder. My ...
Giwoon Lee's user avatar
0 votes
0 answers
70 views

I'm using EF Core 9 and I'm trying to run a migration against a copy of our production database. On our local development databases everything works, but on the production copy the migration fails ...
heaxyh's user avatar
  • 633
4 votes
1 answer
103 views

I have a simple question about covariance/contravariance here. Below, I have a Func<T1, T2> that I need to be casted to Func<T1, object>. In theory, this should be possible, but in ...
Daniel Möller's user avatar
-2 votes
0 answers
61 views

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 ...
SPlatten's user avatar
  • 5,861