1,622,382 questions
Tooling
1
vote
4
replies
88
views
How to avoid forgetting to use the C# using statement
I find myself quite regularly forgetting to use the using statement when getting IDisposable objects in my code. Unfortunately the CA2000 analyzer is quite limited and doesn't usually trigger in ...
Best practices
0
votes
5
replies
73
views
Optimizing imaging in WPF application
Briefly about the question:
How to reach same performance with images like explorer, FastStone Image Viewer since they allocate not so much memory unlike my app.
About the project
It's WPF C# image ...
0
votes
1
answer
91
views
How to fix speed inconsistency between negative and positive addforce on the x axis in unity
if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) && IsOnGround)
{
P_Rigidbody.AddForce(GroundSpeed, 0, 0, ForceMode.Acceleration);
}
else if (Input.GetKeyDown(...
Best practices
1
vote
5
replies
207
views
In C# 14 how to sort an array in reverse order?
What is the most idiomatic way to sort an array in reverse order in C# 14? Arrays now have methods from the MemoryExtensions class.
For example, given the following array:
int[] arr = [3, 1, 2, 5, 9];
...
1
vote
0
answers
38
views
Avalonia StorageProvider crashes in webassembly when selecting files on local system
I'm developing a simulation program in Avalonia 12. It works well on desktop, but there are a few issues with the webassembly version.
The biggest challenge is local file access. I'm using the ...
2
votes
1
answer
111
views
TreeView.AfterSelect triggered by TreeView.SelectedNode = null
I am just learning C# and I am struggling with a treeview in a Winforms project. According to MSDN the TreeView.AfterSelect event does not occur when a tree node is unselected:
https://learn....
0
votes
0
answers
49
views
How can I place a circular (curved/round) stair in Smart 3D (S3D) using a custom command in C# & .NET?
How can I place a circular (curved/round) stair in Hexagon Smart 3D using a custom command in C#?
I can create a straight stair in Hexagon Smart 3D using:
Stair stair = new Stair(system, part, top, ...
-1
votes
0
answers
84
views
Async/await locking where await Task.Run does not in ASP.NET MVC application [closed]
I have an ASP.NET MVC application on .NET 4.7.1. This is a POST method on a System.Web.Mvc.Controller. If I call AnotherMethodAsync directly with await, the application locks up on that line and never ...
0
votes
0
answers
45
views
How do I return a value from a popup with VS 2026 in a maui app
I'm trying to return a string from my popup. The code-behind I have looks like this:
public partial class SelectDb : PopupPage
{
SelViewModel Sv;
TaskCompletionSource<string> taskCompSrc;...
0
votes
1
answer
51
views
builder.Services.AddRequestTimeouts - 504 Gateway Time-out
I've done all the setup and it's not working. I configured the program.cs file, added the policy from AddRequestTimeouts to the controller, and its still returnig a 504 error.
I configured the timeout ...
Best practices
0
votes
5
replies
70
views
Stripping quoted/replied content from HTML email bodies across clients with regex. which markers am I missing and where will it break?
Goal - Extract links from email Body
I extract links from outlook emails where I need to avoid counting links from the quoted thread (contents from prev mails in the thread)/ signature that clients ...
Best practices
0
votes
6
replies
154
views
how to read from external data files into structs
Currently have 32 external (struct) files in my thumbdrive
Have a file that contains names of each of the 32 struct files (filelist.dat)
Need to find a way to read data from each of the 32 external ...
3
votes
1
answer
88
views
Including EXE in NuGet Package with Visual Studio 2026
I am attempting to include an EXE in a NuGet package, but when the NuGet package is installed, the EXE does not show up in the output directory as expected.
In my production environment, I get build ...
0
votes
1
answer
160
views
What is the correct syntax to call this method?
I am trying to use Prism (DryIoc) for dependency injection.
Given the following class:
internal class MainWindowViewModel : BindableBase
{
private readonly ITestingService _testingService;
...
0
votes
0
answers
60
views
.NET MAUI Windows Switch (ToggleSwitch) shows white background for disabled OFF state and hover OFF state
I am working with .NET MAUI on Windows (WinUI) and using the default Switch, which maps to ToggleSwitch.
I am trying to achieve consistent styling for different switch states, but I am facing issues ...
