Questions tagged [c#]
C# (pronounced "see sharp") is a high-level, statically typed, multi-paradigm programming language developed by Microsoft. C# code usually targets Microsoft's .NET ecosystem, which include .NET, .NET Framework, .NET MAUI, and Xamarin among others. Use this tag for questions about code written in C# or about C#'s formal specification.
1,620,401
questions
0
votes
0
answers
9
views
SpecFlow isn't able to find test results in test results file
I'm trying to set up SpecFlow. I have set up my configuration to create .trx files for test results so that I can upload them to Azure DevOps using SpecFlow. I assume I set something up incorrectly in ...
-6
votes
0
answers
47
views
How do I schedule doctor Apointment? [closed]
What method do you recommend for doing this? What code should I use? I have no idea. please guide me. To schedule a doctor's appointment: with Asp.Net Core / Razor Pages ----- In one input, I receive ...
1
vote
3
answers
85
views
Fast integer sqrt using Math.Sqrt
I'm trying to calculate the square root of integer values. It doesn't need to be very accurate, but it should be fast and deterministic across platforms. I'm using this for a RTS game with lockstep ...
-3
votes
0
answers
52
views
Getting text from a string [duplicate]
I am using this pattern below
<a href=.*##ENCLICKTAG##2104.*\s*<\/a>
To extract the first "a" tag content from this String below
<a href="##ENCLICKTAG##2104&&...
0
votes
0
answers
24
views
Issue with Building .sqlproj Project on macOS Due to Missing SSDT References
I'm currently working on a .NET 6 project. It includes a .sqlproj file for database schema management.
Problem faced
When trying to build the project with the .sqlproj file on macOS, I get build ...
0
votes
2
answers
72
views
Console outputs the following line incorrectly
.NET 8
I have a Middleware that reads the request response:
public async Task InvokeAsync(HttpContext context)
{
var originalBodyStream = context.Response.Body;
using (var responseBody = new ...
1
vote
0
answers
30
views
How to calculate Running balance in RDLC reports?
I have an application that uses C#, Entity framework core & MySql database for tracking income & expense and i'm using RDLC for reporting.
I have a transactions table for tracking income and ...
0
votes
0
answers
24
views
create migrations in an unit test project
I have an ASP.NET Core Web API project with EF Core and a SQL Server database using the repository pattern. All works fine.
I added to the solution an xUnit test project and referenced the Web API ...
0
votes
1
answer
33
views
Somehow counter in c# unity script adds 2 instead of 1
I have this piece of code which detects when the wall passes the player, and increases the counter. For some reason, the chunk sometimes stays in the same position twice, adding to the counter twice. ...
0
votes
0
answers
25
views
I do not understand difference between multi-cast delegates and events [duplicate]
I can achieve everything which event can achieve using multi-cast delegate.
you name it
Can anyone explain with an example
The only difference I can see is event keyword
The most common answer I heard ...
-1
votes
0
answers
59
views
Why does my project try to reference a file path that I cannot find anywhere in the folder?
I'm building an application in C# using VS 2017. I keep getting an error "Could not find file 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\FlowMotionRelations.txt'" ...
0
votes
0
answers
33
views
Why not BOTH Debug.Assert and Exception Throwing
This Debug.Assert vs Exception Throwing has been beaten to death. I understand the difference. Assert is a programmer error; an exception is for an external unexpected condition. I get it.
But, in the ...
-1
votes
1
answer
34
views
Getting a timeout only in GitHub Actions when trying to use SQL Server with TestContainers
This is my first time trying to use TestContainer. I am using it to make sure the tests run on a fresh database. This works with Docker Desktop locally and runs quite fast. I am now testing to see how ...
0
votes
0
answers
19
views
Windows Server 2022 .Net 4.7.2 System.Data.SqlClient.TdsParser Error randomly thrown IIS Version 10.0.20348.1
I have been banging my head against the wall today trying to troubleshoot an error that is thrown inconsistently for the past few weeks. The stack is below (some class and namespace names have been ...
-1
votes
0
answers
26
views
My WPF app is not displaying text correctly in some datagrids [closed]
This is the UI on a windows 10 machine
This is the UI on my IDE and other PCs
As you can see the text is missing and the context menu isn't openning
I tried reinstalling graphics drivers, updating ....