Questions tagged [.net]

Do NOT use for questions about .NET 5+ or .NET Core - use [.net-core] instead. The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI.

320,240 questions
0votes
0answers
13views

It's possible to keep a socket in a thread running for months in a server without interruption?

I have a .NET desktop application running on a server, whose function is listen to messages from fingerprint and face recognition devices, and grant access or not. Sometimes the application stops ...
0votes
0answers
15views

"Object reference not set to an instance of an object" - When adding an MVC5 controller using Entity Framewoork

When adding an ASP.NET MVC 5 controller using Entity Framework, I get an error: Object reference not set to an instance of an object Here is what I did: Created a new ASP.NET Web Application (.NET ...
-5votes
0answers
18views

Rest api link for crud operation [closed]

I need rest api link for crud operation. Where to download or copy the link. Kindly help me guys. I need a link that perform all the methods get, put, post and delete.
0votes
0answers
8views

How Do I Solve Could not load file or assembly class library "Microsoft.EntityFrameworkCore version = 6.0 in Class Library

I have two problems interlinked with each other. First, I am creating for the first time a C# class library in .NET 6 that is a data access layer for other apps. I have never created a class library ...
1vote
1answer
34views

Can i use C# 11 features in .NET 6?

I'm studying the new features about C# 11 and i don`t know if i can use it with .NET 6.0 or only in .NET 7.0. I also saw that i can lock the version of C# like this: <PropertyGroup> <...
-1votes
1answer
35views

How to run code between asp.net and console app?

i have asp.net project and console app I would like to execute a method in my console app project once the person has access to a page of my site how to do? since he is launching into different ...
0votes
1answer
18views

How to make a border around a stackpanel which stops at the last element inside it?

Currently I have a stackpanel with 2 buttons which I have placed in a single row whithin my grid. I want to draw a border around the stackpanel, but the stackpanel is filling the whole row, it doesnt ...
0votes
0answers
30views

Is it possible to use a C struct in C# applications with P/Invoke?

So I have an application written in C# which uses a library in C++ that I am wrapping using P/Invoke. When you initialize a Foo object, you hand a callback function with the signature: typedef void (*...
0votes
1answer
12views

msbuild error, "SetEnv" task could not be loaded from assembly Microsoft.Build.CppTasks.Common

I have msbuild version 14.0.25420.1 on my win10 command prompt computer, If I try to build a visual studio project file with this command: msbuild .\folder1\WxsGenerators.sln I get an error BUILD ...
0votes
1answer
51views

What do these Square Brackets C# syntax mean infront of Function Parameters? It looks like attributes

I'm trying to work out what this code does. It's part of the .NET framework and MS Azure; I have a C++ background, but (obviously) C# is a different animal. Having spent much time googling "...
0votes
0answers
12views

Error XA2002: Can not resolve reference: `Microsoft.Bcl.AsyncInterfaces`

I want to run my app in xamarin.forms but I faced this problem Error XA2002: Can not resolve reference: Microsoft.Bcl.AsyncInterfaces, referenced by SimpleInjector. Please add a NuGet package or ...
0votes
1answer
44views

C# - Efficiently search through a data set

For my project, I have to search through a data set to find a string that matches. Previously, it was implemented by comparing every single item with the result string, but now my team wants it to run ...
0votes
0answers
29views

.Net endpoint not found - memory full

There are around 100 PC's in my network. Each PC has a script that is run on 'Task Scheduler' at a certain time. The purpose of the script is to move .csv files to a server as a backup. I'm trying to ...
-4votes
0answers
34views

Is async await really that great? [closed]

I've recently started looking into async/await mechanism in c#. While I find it very cool that there's such a neat way to avoid using threads for things like I/O bound calls, it doesn't seem that ...
0votes
0answers
29views

Should I unit test my Validator, my Controller, or both?

I have a controller with a big request. We decided to use FluentValidations to validate it before proceeding with method. My question is, should I test my implementation of AbstractValidator, should I ...

153050per page