Category "c++sharp"

How to update C# version in Visual Studio Code?

I have installed C# extensions, my .NET framework is updated, I just can't fix it.

CompilationFailedException during runtime compilation of Razor from AspNetCore TestHost

I have ASP.Net MVC application, one part of it is compiling razor views to string. The code is very similar to this example: https://long2know.com/2017/08/rend

Use C# for Catia V5 Automation

I want to write Macros/Programs for Catia V5 with the programming language C#. How is it possible to access the Catia applicataion via c#(and Visual Studio). I

How do I use IConnectionPoint to capture the "Forward As Attachment" event?

In this article, How to detect Outlook Events ..., Dmitry Streblechenko outlines how to subscribe to Outlook Events not listed in the TypeLibrary. Would these

the type or namespace name 'RuntimeCompilation' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Razor'

If I write this line of code, services.AddMvc().AddRazorRuntimeCompilation(), in startup.cs and while publishing the project from Visual Studio 2019 on Azure, I

Multiple using of || and && operands

I have a query using Entity Framework. It has many different operands and I am confused with its priority. I am getting the wrong result. I need all records tha

How to load razor page before it's done rendering?

I have a table of records in Index.cshtml, once a user clicks on a record to view the details it will take them to Details.cshtml. The issue is, there is a lot

Showing #value! before enable editing on excel if I write formula using epplus

Using C# .net core I am updating existing excel template with Data and formulas using EPPlus lib 4.5.3.3. If you see the below screen shots all formula cells ha

Inconsistent Accessibility in Lists c#

I'm following an RPG c# tutorial, and have come across this error. It is not explained in the tutorial, and I'm unsure what i did wrong. Here is the class: usin

Pass current transaction to DbCommand

I'm working on a project using ASP.NET Core 2.1 and EF Core 2.1. Although most of queries and commands use EF, some units needs to call stored procedures direct

Microsoft.AspNetCore.OData 8: controller is not found by convention

As described in the docs, Microsoft.AspNetCore.OData 8 uses a convention to tie a controller to an entity set. They also provide a sample that demonstrates this

A second operation started on this context before a previous asynchronous operation completed

Message: "System.NotSupportedException was unhandled Message: An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll Additional

Is there a way to skip MediatR Pipeline?

I would like to cache some responses from CommandsHandlers. I Already did this using IPipelineBehaviour, but only 5% of my requests really must have cache, and

Convert image byte array to PDF

I'm looking to convert an Image (PNG, JPEG, GIF), in the form of a byte[] to a PDF. I'm currently using this function, which works, but cuts off the bottom of i

DotNetCore 1.0 MVC how to automatically redirect to a single domain in live

I have multiple domains for a website: http://example.com http://www.example.com http://www.example.co.uk In production, I want the primary domain to be htt

Converting C# into Powershell with DllImport involved

I've recently been working on a little side project to see if I can get a little memory editing to work with PowerShell. I put together a small script in C# tha

C# Service HttpClient reponse null

I have gone through all the possible posts and I have not found any solution that works for me (There is no more to see the mess in imports), please help. :( I

How does GameRanger works?

I want to know how does GameRanger make players appear in the Multiplayer's LAN section of the games. Because in my observations there is no signs of Virtual Ne

Can't create an inference session in onnxruntime

I am not able to create an instance of InferenceSession using onnxruntime. My platform is Mac OS(Big Sur). The code doesn't even throw any exceptions. Process i

How to change value of XML Node with Self closing Tag using C#

I have an XML file, which is being loaded into an XmlDocument object in my code. It contains some nodes which have self closing tags. How do I access and change