Category "c++sharp"

c# check value at design time

Is there any way, perhaps by use of Contracts, to check whether a variable's value conforms to some rules during design time in Visual Studio 2022? I.e. int is

Azure File Share : Find files with same first part of the filename C#

I have large number of files in a file share directory. Some of the files have their first part of the names are similar. I have to copy these files to another

how to create list of lists in c#

I am trying to create list of lists, where the large list represent paper contain collection of small list represent question, list of question consist of quest

ASP.NET MVC Core API Serialize Enums to String

How to serialize Enum fields to String instead of an Int in ASP.NET MVC Core 3.0? I'm not able to do it the old way. services.AddMvc().AddJsonOptions(opts =&g

. Symbol Breaks Routing

Currently scratching my head as to why routing to one of my functions is failing. The route is defined via an attribute: [Route("emails/{emailAddress}")]

Make RichTextBox automatically scroll to bottom when content is added

I have a WPF UserControl with a BindableRichTextBox: xmlns:controls="clr-namespace:SysadminsLV.WPF.OfficeTheme.Controls;assembly=Wpf.OfficeTheme" . . . <cont

Valid Azure Blob Metadata Identifiers

I've been trying to add metadata on an .mp4 video that is stored on an Azure Blob. I want to add opengraph tags and when I try and enter them in, I get a messag

Oracle OLEDB Memory Leak 12.2 and Greater (SSIS and C#)

I have found an issue with the Oracle OLEDB Driver “Oracle Provider for OLE DB” and MS SQL SSIS Packages. This was first found in SQL SSIS packages

How do I mock AddAsync?

I'm writing unit test. For testing the method below, public async Task<Guid> CreateWebJobStatus(string blobId, Guid loggedInUserId, string loggedInUserE

Custom Tooltip on LineChart (lvChart)

I closely follow step-by-step lvChart Customizing Tooltips in trying to build a custom tooltip for LineChart points. But I get empty tooltip content. Other than

LINQ query returns error "The expected type was 'System.Int32' but the actual value was null."

So this is the query: from c in Contents join cs in DepartmentSharings on c.ContentId equals cs.ContentId select c.PrivateCategoryId.Value When I run this I

Could not load file or assembly 'Microsoft.IdentityModel.Protocols.WsFederation

I have a ASP.NET legacy project to which ADFS authentication needs to be added. So I did the same but when I run the application, I keep getting this error:

Cannot load System.Web.HttpContext error with razor pages and WebMail

I've been having trouble getting WebMail to work sending an email using a contact form using This Official Microsoft Tutorial. My current issue is that I'm get

XAML/MVVM help for implementing screen grid

As a complete beginner to XAML/MVVM I would like to request some help with implementing a 24x14 letter screen. The XAML implementation is quite easy I think wit

Best practice to handle concurrency in EF Core and ASP.NET Core?

Currently I'm doing the following when inserting/updating and entity: public async Task<IdentityResult> UpdateAsync(Model model, CancellationToken ct = de

Efficient long multiplication with double word result

I am trying to optimize the multiplication code of a 31.32 fixed-point math library written in C#. The (incorrect) pseudo code is: long result = (a * b) >&g

Trying to submit a payment, to a 3rd party payment gateway, through POST request :S

I am mimicing a user buying a product on a website: www.footlocker.dk. All that works fine, the HTTP session adds the product to cart, submits delivery informat

VS Code / OmniSharp - how to set path to dotnet SDK / CLI tools explicitly

I'm using Visual Studio Code. On my machine, I have two separate installations of the Net Core SDK / dotnet CLI tools; an outdated version (netcore 1.1) in the

What exactly is 'UseAuthentication()' for?

I have a question regarding authentication in ASP.NET Core 2: what exactly is the call app.UseAuthentication() for? Is it a basic prerequisite so that I can i

Visual Studio 2022 .razor code block is flickering

I am using Visual Studio 2022 Enterprise. While working with .razor files I have a strange flickering. Since a while my syntax highlighting is broken. As you ca