1,622,995 questions
Best practices
0
votes
0
replies
22
views
How to prevent DuplicateKeyException when using MongoDB upsert with optimistic concurrency (versioning)?
I'm using MongoDB with the .NET driver and trying to implement an optimistic concurrency pattern with versioning using UpdateOneAsync and IsUpsert = true.
Here is my code:
public Task UpsertAsync(User ...
2
votes
0
answers
57
views
How to trigger nullability check in C#? [duplicate]
Say, I have this extension which throws exception when `fileName` is null or when file does not exist.
internal static class ExceptionExtensions
{
extension(FileNotFoundException)
{
internal ...
0
votes
0
answers
42
views
WinForms / .NETFramework: Format DataGridViewCell according to ValidationResult
Consider a small Winforms application that has a list of custom objects bound to a DataGridView.
The data class:
public class MyAwesomeClass : IDataErrorInfo, INotifyPropertyChanged
{
string _Name;...
0
votes
0
answers
69
views
Errors using Hot Reload (Alt-F10) in Visual Studio after making some changes to the code
Hot reload works for me, but it throws errors after a short period of using it.
I am currently working on a complex ASP.NET solution containing a main website, apis and other auxiliary projects inside ...
1
vote
1
answer
44
views
How can I retrieve extended information for a Branch in Acumatica from Bills and Adjustments (AP301000)?
I am working with this version of Acumatica:
Acumatica Cloud ERP 2025 R1Build 25.101.0153 +
I would like the extended data for the Branch to be populated whenever the Branch is changed in Bills and ...
-4
votes
0
answers
141
views
"Excel cannot open the file '.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted..." error [closed]
I am using this C# code to generate the an Excel file from my app, and it worked fine when the .xls file is generated, but when I changed it to .xlsx, now I get an error shown in the title when trying ...
2
votes
1
answer
56
views
How to create and implement templates that allow for information to be automatically filled in on envelope creation using Docusign API
Problem
I’m using the DocuSign eSignature API with composite templates and can’t get prefill (sender-filled) text tabs to populate when creating an envelope.
What I’m Doing
I built a template ...
-3
votes
0
answers
91
views
Pros and cons of testing for differences vs. directly updating an entity [closed]
I'm working on updating a database table from an external source, with Entity Framework Core to access the database.
The table T_CAT looks like this:
CAT_NAME varchar(20) Not Null,
CAT_FUR_COLOR ...
-3
votes
0
answers
62
views
why AllowPromptAsInput property is not worked when PromptChar = '0' in C#? [closed]
I create a MaskedTextBox for BirthDate where Mask = "00/00/0000" and when User try to Enter 0 Like 02/02/2001 the result is 2/2/2 1.
I try to make AllowPromptAsInput = true but nothing ...
0
votes
0
answers
56
views
How to prevent Entity Framework Core from using Table-Per-Hierarchy (TPH) mapping
I use MongoDB.EntityFrameworkCore.
I have 3 classes: Pod, Planet, Asteroid with inheritance from SpaceObject
I want use the default Table-Per-Hierarchy (TPH) mapping for Planet and Asteroid to save ...
0
votes
0
answers
58
views
Project deps.json not populated when using project reference, even though it is with built NuGet package
I have a solution containing a class library project. That class library project includes a native library, which I place in the subdirectory runtimes/<rid>/native. I have the .csproj configured ...
0
votes
0
answers
98
views
MudBlazor still not compatible with .NET10? [closed]
I've created a Blazor WASM project and I can publish it. After adding the MudBlazor 9.2.0 nuget package I can no longer publish and get this error:
Package Microsoft.AspNetCore.Components....
0
votes
0
answers
106
views
Scrollviewer.ComputedVerticalScrollBarVisibility doesn't change in a loop
I have a user control made of white border, a ScrollViewer and a RichTextBox in it, which supposed to display a footnote text when the mouse is over the footnote special sign in the text.
<Grid>
...
-1
votes
1
answer
89
views
"`ElementReference` is not assignable to parameter type 'object?[]?" error on `InvokeAsync` method [closed]
I got error
Argument type 'Microsoft.AspNetCore.Components.ElementReference' is not assignable to parameter type 'object?[]?'
at line this.rootElement of
protected Microsoft.AspNetCore.Components....
1
vote
1
answer
86
views
ASP.NET Core HealthCheck wants a database migration, but I can't figure out what migration it wants
My ASP.NET Core app is throwing this exception, and I can't figure out how to resolve it:
An error was generated for warning 'Microsoft.EntityFrameworkCore.Migrations.PendingModelChangesWarning': The ...