1,621,658 questions
Score of 1
1 answer
116 views
Unable to set HTML clipboard content in X11 session using Avalonia
Here's my very simple test:
var htmlFormat = DataFormat.CreateStringPlatformFormat("text/html");
var item = new DataTransferItem();
item.Set(htmlFormat, "<b>Bold HTML Content</...
Score of -5
0 answers
81 views
Unity mobile input field: multiple carets showing [closed]
At first, on mobile, text mesh pro input field caret were not showing in the mobile, while it was perfectly working on standalone. Then, in order to show on mobile, I found in input field you have to ...
Score of 0
2 answers
120 views
NuGet vulnerable with Microsoft.Data.SqlClient 7.1.1 depending on System.Security.Cryptography.Pkcs 9.0.18
I have a strange behaviour when using .NET 10 Library referencing NuGet Microsoft.Data.SqlClient 7.1.1. I receive a vulnerable warning of a transient package System.Security.Cryptography.Pkcs in ...
Score of 2
1 answer
139 views
How to enable HTTP/2.0 for unencrypted http requests in Kestrel
I have a C# & .NET 10 app running on top of Kestrel web server. The app runs in a Docker container, and is passed requests via a proxy nginx server.
I want the nginx proxy to accept http/2.0 ...
Score of 1
1 answer
111 views
Exceptions in IAsyncEnumerable not passed upwards properly [closed]
I've been dealing with a rather odd issue with C# where, if an async function called by an IAsyncEnumerable function throws an exception, this exception is unhandled, despite the function which called ...
Score of -3
1 answer
148 views
How do I insert a string variable into a JSON string in C#
I have this string which is converted to JSON and sent to Teams:
var messageJson = @"
{
""type"": ""MessageCard"",
""attachments&...
Score of 1
1 answer
248 views
Most efficient way to fill a stream with zeros?
I have Stream from opening a file in the filesystem, and a want to replace the contents of this stream with zeros. I.e. each byte of the stream should become 0. I wrote the extension method ...
Score of -6
0 answers
67 views
Why does Console.ReadKey not update console until I press enter? [closed]
I am trying to make a game in C# for console, and I need a way to read real time input. I've tried looking up a way to use Console.ReadKey, but the code I find still requires me to press enter for the ...
Score of 2
1 answer
193 views
How do I send a message to a Teams channel from a C# application with a web hook url
I am trying to send a message to a Teams channel from a C# application using a valid web hook.
This is my code:
var messageJson = @"{
""type"": ""message"&...
Score of 1
1 answer
215 views
Problem with downcasting to an interface with a generic type
I need to create a WPF application, which would display, allow to edit entries of some database, etc. I decided to create a special UserControl for displaying each entry of each table from my DB using ...
Score of 4
1 answer
103 views
JQuery validation not working in new ASP.NET Core MVC web application
We are developing a web application in ASP.NET Core MVC, which has some special requirements. It has to be multilingual (target most of W. Europe), with both client-side and server-side validation. ...
Score of -4
0 answers
88 views
Drop database with missing .mdf file in SQL Server (localdb) [duplicate]
In my C# app, the initialization process for a SQL Server running on a localdb is mainly automated. My app should also deal with a missing .mdf file. That's why I deleted my .mdf file after closing my ...
Score of 2
2 answers
155 views
The property '{EntityName}.{PropertyName}' is part of a key and so cannot be modified or marked as modified
I'm working with a legacy SQL Server database that features a table Book_Reservation. Among other things, it has these three columns:
Book_Code varchar(10) NOT NULL,
Reservation_Date datetime NOT ...
Score of 4
4 answers
223 views
Downcast generic interface (INumber<T>) to derived generic interface (IBinaryInteger<T>)
My generic class takes a T that implements INumber<T>.
I want to call different methods based on T being a IBinaryInteger<T> or a IFloatingPoint<T> :
class Data<T>
where T : ...
Score of 2
1 answer
169 views
How to use one sequence per table in Entity Framework Core to generate new primary keys on INSERT in SQL Server
I have a SQL Server database that was migrated from an Oracle database, which used explicit sequences created for each table to provide primary key values on INSERT. A different application using ...