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

Websocket in dotnet with API Gateway and Fargate?

I'm building an ASP.NET core project. The bulk of it is a REST API, which we have deployed in a Fargate Container behind API Gateway. Those are partly client requirements, not my decision. For part...

3 May at 17:34

PDF chunking for vector embeddings options?

I'm building a RAG on dotnet web api and looking for library/libraries that can take in a PDF and create text for vector embeddings (and possibly do the splitting strategy). Does anyone have any recom...

3 May at 17:33

In Windows we have IIS but what do we run dotnet websites when in Linux

Just curious what alternatives people use to run there app on linux hosting if not in azure? Is the standard these days some kind of plesk install

3 May at 17:32

LDAP integration in dotnet 6.0

We have a Web Api project in Dot Net 6.0 which is being hosted in Docker Linux Container and deployed in AWS ECS. Since the **System.DirectoryServices** only works on Windows , we have tried to use...

3 May at 17:31

Is this a misuse of Dispose?

I'm reviewing a class that implements `IDispose` and therefore has a Dispose method. In the constructor of this class we open a DB transaction. In the dispose method we commit the transaction and exe...

Best way to build static site?

I am a fresh graduate new to dotnet, C#. I am mostly building APIs and web apps using MVC for the past few months for my job. Now, I've got a client who needs a few static websites. What would be th...

3 May at 16:7

How to open an Angular+.NET project in Visual Studio GUI after creating it in VSC?

I have a [Angular+.NET](https://Angular+.NET) project where the 'client' folder holds the Angular files and 'api' folder has the .NET project. I started working on it in Visual Studio Code and jus...

3 May at 16:7

Web app container running .net with SMB access?

Has anyone managed to run .net code in a docker container running on an azure web app that can connect to a share using SMB? I'm looking to move some work loads to web apps rather than AKS for now....

3 May at 16:6

Settle an Argument (Logical/Physical Layers, Clean Architecture, etc).

A colleague and I are going through an exercise of developing guidance around practices and conventions for writing Clean Architecture projects in our organization. We have project structure as fol...

Piece of code that can kill computer performance

I'm searching for code in c# that can kill computer performance (CPU performance, maybe cpu - memory link performance too) as much as it is possible (it will run on 4 core box so I'm going to create 4...

30 Apr at 13:37

ComboBox SelectedItem binding not updating

I'm a bit puzzled: this works: ```xml ``` and the property for SelectedRol is: ```csharp public TblRollen SelectedRol { get { return _selectedRol; } set { ...

30 Apr at 13:36

Reformat SQLGeography polygons to JSON

I am building a web service that serves geographic boundary data in JSON format. The geographic data is stored in an SQL Server 2008 R2 database using the geography type in a table. I use `[ColumnN...

30 Apr at 13:35

Add web service reference from behind a proxy server

I'm using vs2010. In a simple console app I try to add a service reference to `http://***/service1.asmx` , old asmx service. My computer is behind a proxy server, so i get an error : > "The remo...

30 Apr at 13:34

No more post back after file download in sharepoint

I tried to download a file from sharepoint. But after I download this file, I can't click on other buttons. What is wrong with my coding? **This is my first way.** ```csharp Response.AppendHe...

30 Apr at 13:34

Sleep task (System.Threading.Tasks)

I need to create thread which will replace photo in [Windows Forms][1] window, than waits for *~1second* and restore the previous photo. I thought that the following code: ```csharp TaskSchedul...

Graphic - DrawLine - draw line and move it

In my .net c# program i draw few lines using values from text boxes (i use DrawLine function). I want to be able to move one of this lines by clik on it and move this line with mouse - is it possible?...

30 Apr at 13:31

Find node when traversing tree

I want to implement a method that will enable me to find a node in a tree. The way I do it is recursively using global variables to know when to stop. **I have the class:** ```csharp class Nod...

30 Apr at 13:30

Why use events for what I can do with Delegates?

I know Events are always associated with Delegates. But, I am missing some core use of Events, and trying to understand that. I created a simple Event program, as below, and it works perfectly fine...

30 Apr at 13:28

Sharing DTOs between my API, Blazor web app and WPF client

I have recently been revisiting a project from a year ago where I had an ASP.NET web API and a WPF client. The WPF client would call the API and each project had a separate models folder where I dupli...

3 May at 15:59

How to handle no matches case in List.First in c#?

In [IEnumerable.First][1] function, how do I handle the case if there are no matches? Currently it just crashes... ```csharp MySPListItem firstItem = itemCollection.First(item => !item.isFolder); ...

30 Apr at 13:26

GridView Command Arguments out of sync after dynamic row inserts

I have a gridview (for displaying data only) with multiple LinkButton objects in each row. In the gridview's DataBound function, I iterate through the rows of the gridview and dynamically to add new "...

3 May at 14:34

Calling multiple external apis.

I'm creating two azure functions, and each one will call different external api. I'm wondering about approach to this. I currently have a `IApiService` and `ApiService` which basically is doing th...

3 May at 14:33

C# how to convert WORD to PDF?

I'm searching for free method to convert word to pdf. I searched for free cli tools, for libraries, but there is no free method i found. I only found this library from nuget - "Microsoft.Office.Intero...

3 May at 14:29

c# csvreader delimiter in value

How parse csv with text in? example csv: ```csv name;comment;count; firstName;LastName;someComment;5 ``` I found on the net that you need to escape the value in the column with the symbol ...

3 May at 14:15

RPC calls - state of the art

Up until recently we had a database where only a client for the classic .NET Framework was available (ODBC setup would have been a horror). My application basically is a webservice (implemented in WCF...

3 May at 14:14

Covariance in C# .NET 4 Framework

Is it possible to cast a `List` to `List` in C# 4.0? Something along these lines: ```csharp class joe : human {} List joes = GetJoes(); List humanJoes = joes; ``` Isn't this what co...

30 Apr at 12:19

Elegant alternative to int.TryParse

I feel that every time I use `TryParse` that it results in somewhat ugly code. Mainly I am using it this way: ```csharp int value; if (!int.TryParse(someStringValue, out value)) { value = 0...

30 Apr at 12:10

Blazor Server App checking checkbox on task list leaves next item checked

I have a task list that users can check off from the list, which disappears because Show Completed Tasks is not checked. However, when the task disappears, the next task item is checked, smh which is ...

10 Mar at 04:4

Access Dns from ASP.NET Core 8 Web API in Docker container

I have built an ASP.NET Core 8.0 Web API that gets the hostname of the connected client with the following code: This code worked just fine as long as I ran it in Visual Studio. Now I want to deploy m...

Deserializing JSON text to an object in C#

I have the following class: On the other hand, I have this json string: When executing: I got this error: > Exception: System.Text.Json.JsonException: The JSON value could not > be converted to System...

10 Mar at 04:15

Is there a way to store a template of interpolated string in C#?

I have this class called `BaseMessage` that contains string field `Message`: And I have another class `ProcessMessage` that derives from `BaseMessage`: Overall this class is created in 500 different p...

10 Mar at 13:7

C# Getter non nullable but setter nullable?

Is it possible to use C# accessors such as the backing field is nullable but the getter is not ? I want the getter to promise to the rest of the code the value is not null Since get; set; share the sa...

10 Mar at 04:30

How does the .net CosmosDb SDK handle tasks in bulk support?

In the [examples for using][1] the bulk support, the tasks created by the SDK are awaited as such: In a more real world scenario, there might be a lot more await/async going on. Developers often await...

Intercept a message rabbitMQClient C#

I am making an integration service for a third party application. This application uses rabbitMQ for its communication. The problem I am having is that whenever rabbit publishes a message, the first t...

10 Jan at 09:20

I need help creating mouse-centered zooming

I've been trying to make a system in my 2D unity game where you can zoom in and out by scrolling, and it should center that zoom around the cursor, like zooming in on a web browser. With the way the g...

10 Jan at 09:35

Removing Noise (Jumps and Drops) from Sensor Data for Fuel Consumption

I am working with fuel consumption data received from a sensor, but sometimes the data contains noise (sudden jumps or drops) that makes it inconsistent. My goal is to identify and remove these outlie...

C# WPF Binding issue

I got this CurrentPage property on my mainViewModel like: public int CurrentPage { get { return _currentPage; } set { if (_currentPage != value) { _currentPage = value; OnPropertyChanged(nam...

9 Jan at 09:43

Why must an internal method of a public interface be implemented via a public method?

I have a public interface. One of its methods is marked internal. And it has to be - it takes an argument that is an internal type. I write a public class that implements this interface, I do so via a...

9 Jan at 09:44

How can I pause a task in C#?

I am a beginner in the use of task in C#. I have implemented a file generation window in my application which generates 3 different files. I have implemented the file generation function on a single t...

9 Jan at 09:44

Use reflection to invoke methods in an assembly that contains a derived-class from the base-class that lives in another assembly

I have two projects/assemblies in a .NET Core solution. 1. Project A contains a base-class called `FooBase` 2. Project B contains a derived-class called `FooDerived`, as well as a bunch of other class...

1 Jan at 10:58

Why aren't the string formats for the float equivalent, and why does "N9" produce a value that is different?

I would like to understand what is going on with this code: where the value of `flt` in the debugger is `0.123`: [![enter image description here][1]][1] The documentation on [the "#" custom numeric fo...

1 Jan at 11:3

How can I execute C# code using Roslyn from a string and use global variables from a Dictionary<string, object>?

I'm working on a C# application where I need to execute C# code provided as a string input using Roslyn. The challenge is to execute this code and access global variables stored in a `Dictionary`. The...

1 Jan at 11:5

Entity Framework keeps throwing Duplicate Primary Key Error Despite Rollback

Running on .NET Framework 4.6.2, I have a method that uses Entity Framework to insert a row into a SQL Server database table. It uses a transaction that gets rolled back if an error is thrown: publi...