Questions

How can I use Windows APIs in C# that do not have a dll?

I am currently working on an "audio mixer" project and am building an application that will interface with my hardware. I was looking into the Core Audio APIs that are part of Windows to try and imple...

12 May at 06:36

Including additional info when logging

What's the recommend or your preferred way to automatically include context related information when logging without needing to write them every time you wanna log something? I would like to make my l...

12 May at 06:33

Hosting an ASP.NET app with a PostgreSQL database.

I’m looking for advice on where to host a basic ASP.NET app with a PostgreSQL database. It’s a simple CRUD app that will only be used by 1 or 2 people, with no additional traffic. Can anyone recommend...

12 May at 06:32

Regarding try/catch block's finally keyword in C#

Okay, so I am very familiar with try and except (or catch in C# ), but the one I am not sure about is the finally keyword used like: I understand that this is supposed to run regardless if the Try or ...

12 May at 06:30

URL Rewrite in an old ASP .NET WebForms App not working for nested routes

I want to do a URL Rewrite in an old ASP .NET WebForms app using the IIS URL rewrite module. I have the following rule in my App's **web.config**. Everything at the folder level works so `servername.c...

How do you implement audit trail for your objects (Programming) ?

I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered on 1. OnSaving 2. OnDel...

7 May at 05:35

Very large string in memory

I am writing a program for formatting 100s of MB String data (nearing a gig) into xml == And I am required to return it as a response to an HTTP (GET) request . I am using a StringWriter/XmlWriter to ...

Finalizer is not being called

I have a class in C# where I want to close out some communication ports properly when my class is being disposed. However, the finalizer is never being called when I exit the program. Why is that? Am ...

6 May at 20:0

Is it Possible to Make a Generic Control in .NET Win Forms?

I've got the following Generic usercontrol declared: But the compiler won't allow me to do this: How do I create a generic user control in C#?

Execution Timeout Expired. The timeout period elapsed prior to completion of the operation

When I run my code I get the following exception: >An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll > >Additional information: Execution Timeout Expired....

6 May at 06:14

Create docx word document web api .net core

I am developing a Web API project in Asp.net core 2.0. I am in need of a library or way to create Word document. I have searched an tried NPOI and DocX. Both are not as good as expected. Can anyone su...

How do you reverse a string in JavaScript?

What's the most optimal and concise way of reversing a string in JavaScript?

5 May at 09:58

MVC to REST API refactor question

I'm creating a REST API that will replace the backend of an MVC site. There's some places in the MVC site that have Validation and Confirmation routes for say, updating profile information. The user c...

3 May at 17:50

How to jump to Blazor SSR?

I'm a backend engineer busy with a startup project thus dabbling in the frontend. Right now I'm using Razor pages with Bootstrap and so far it worked pretty nicely for the initial phase of the proj...

3 May at 17:49

What's a good solution for collecting metrics for notification purposes?

I have a console application that I want to add metrics to. But not the usual metrics (performance). Maybe a better term is _statistics_. Essentially, at certain points in my application, I want to re...

Anyone knows how to register a custom IViewLocationExpander in .NET Core?

This is the old way to add a "MyViewLocationExpander" with a Startup.cs file (from StackOverflow) ```csharp public class Startup { public void ConfigureServices(IServiceCollection servic...

3 May at 17:46

Best hosting option for Windows Server 2022, ASP.NET and SQL Server

I have a .NET FX ASP.NET application to host. What are the best hosting option for Windows Server 2022, ASP.NET and SQL Server, I mean I want my own Windows server that I access remotely. Criteria ar...

3 May at 17:44

Is there any way to use a .NET Standard 2.0 Library that relies on EF for both .NET Framework 4.8.1 and .NET 6

We want to migrate from .NET Framework 4.8.1 to .NET 6 (.NET Core 6). However, business-wise, we can't afford to both migrate the entirety of our solutions on one side while adding new features in...

3 May at 17:42

Creating .NET applications on Linux

I am planning to learn C# and .NET Core and the tutorials are all in visual studio which is not supported in Linux. It's alternative is visual studio code on linux but what are the limitations of visu...

3 May at 17:41

Difference between Infrastructure and Persistance layer in Clean Artchitecture ?

I'm currently learning how to build an API with a clean architecture. After reading a few articles, I followed a tutorial, and looking at what the final project looked like, I saw that the “Infras...

3 May at 17:40

C# .NET backend with a JS framework frontend?

I have been learning ASP .NET CORE for the past 4 months to go with a react/next frontend... Works great and I much prefer it to using node etc, I apply to the jobs that say they use react/angular on ...

3 May at 17:39

IIS 401 when I transported a site .NET 4.8 to a different IIS host.

The site is .NET 4.8 with **OWin**. I copied it from 1 working 2008 R2 box to another. I'm now getting 401's on several pages. It feels like authentication but I've double/triple checked th...

3 May at 17:38

How to execute class library?

I've created a web project with different layers from domain to web API. And just when I wanted to run it for the first time I've realised it's a class library and it doesn't have Program.cs thus no e...

3 May at 17:37

Why choose minimal API over controller based API?

I'm currently a student learning about minimal APIs. I am a little confused about their importance. Are they genuinely useful, or are they just a nice-to-have with little practical use? I've read a nu...

3 May at 17:36

How implementation DDD with EF Core ...

I've returned to using EF Core for a DDD project after a long time away. Previously, I worked with Spring. Implementing DDD with EF Core seems more challenging than I expected, particularly for com...

3 May at 17:35