Skip to main content
Filter by
Sorted by
Tagged with
9 votes
2 answers
236 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: ...
1 vote
1 answer
64 views

I need to count the number of columns in a Table in an Access Database. The following code does the job, but I wonder if there is a better way using INFORMATION_SCHEMA.COLUMNS ? CmdStr = $"...
0 votes
1 answer
55 views

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 ...
9 votes
5 answers
6k views

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 ...
1 vote
3 answers
8k views

I am Trying to generate random Ids from a given table. I can see the random number generated in debug but when I reach to reader.Read() line it shows Enumeration yielded no results. I couldn't quite ...
1 vote
1 answer
4k views

I'm facing an issue with uploading a file via the Drag'n Drop API. Here the following blazor component: <InputTextArea @ondrop="HandleDrop" @ondragenter="...
0 votes
1 answer
2k views

In a WinUi 3 MVVM project I have a media (image and videos) Json list that plays one my one with a certain duration, I am trying to add a fade in and out whenever the image changes, I have tried ...
1 vote
0 answers
37 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 ...
0 votes
0 answers
72 views

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 ...
0 votes
0 answers
59 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 ...
3 votes
2 answers
1k views

I tried various methods given online to insert an image in Crystal Reports dynamically from database but it did not work for me. The Image is still not getting displayed. I have tried doing it by ...
-1 votes
0 answers
28 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 ...
0 votes
1 answer
11k views

I have a test which runs a script. It gets the path from the app.config file: <scriptsSectionGroup> <scriptsCollection> <scripts> <add name="TestScript" path="C:...
Best practices
0 votes
1 replies
49 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 ...
3 votes
7 answers
15k views

I need to get all the content inside the body tag of an HTML file using C#. Are there any good and effective ways of doing this?
0 votes
2 answers
64 views

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

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 ...
2 votes
3 answers
5k views

My applicattion is WPF: I want to open the local file help.html of my project in the default browser. I have created a button Help, in the event I want to open this .html. I have some problems with ...
8 votes
11 answers
16k views

Using C# how would one determine if a URL is an intranet URL? I would like some code to do something if a URL is an intranet one vs public.
-5 votes
0 answers
27 views

I'm working on a translation workflow using SDL Studio solution through API calls. Works just fine, our tool can call upon Studio to create a translation project, fill it with the files to be ...
33 votes
9 answers
97k views

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 ...
50 votes
14 answers
46k views

I'm trying out Blazor ServerSide and created a Component to Redirect To the Login Page when a user is not logged in. @inject Microsoft.AspNetCore.Components.NavigationManager NavigationManager; @...
5 votes
3 answers
2k views

I have the following code which inserts data into the SQL server database. The database table DataEntries column IssueDate is of data type Date. There is a problem with the IssueDate = DateOnly....
0 votes
0 answers
48 views

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....
12 votes
4 answers
11k views

When querying a database with EF Core, it's easy to conditionally add .Where clauses to a query before executing the query, e.g.: [HttpGet] public async Task<List<Entity>> GetEntitiesAsync(...

1
2 3 4 5
32479