Category "c++sharp"

Getting "Metadata generation failed" when building C# function app in Visual Studio 2019

Starting with a C# function app created as a new project in VS2019 (16.4.1) and latest Azure libraries (Azure Functions and Web Jobs Tools 16.4.457.38025) from

Store Entity Framework Core SQLite file in project-relative subdirectory

I have an ASP.NET Core 2.0 app using Entity Framework Core and the SQLite Provider. I am trying to store the SQLite database file in a subdirectory (specificall

C# equivalent to Java Robot class

What is the C# equivalent to Java Robot class for mouse pointer movements? As Actions class cannot be used directly for keyboard and mouse. I need to move my mo

C# check object type against multiple types

IS there a way to pass an array of types to the "is" operator? I am trying to simplify the syntax of checking an object against multiple types. Something like

.Net Core 2.0 The view 'Index' was not found

I deployed .net core 2.0 application to IIS and I get the following error. InvalidOperationException: The view 'Index' was not found. The following location

Is there a way to overload commands in Discord.net?

I have two modules for my Discord Bot: The first one is the UserModule, where every commands are, that users can execute, and the second one is the AdminModule,

Converting JObject to a dynamic object

I am calling a REST endpoint from C# and I am receiving json which gets serialized into an object. One of the properties on this object is a dynamic property. T

what is the best way to split string in c#

I have a string that look like that "a,b,c,d,e,1,4,3,5,8,7,5,1,2,6.... and so on. I am looking for the best way to split it and make it look like that: a

'Nullable object must have a value.' for List in LINQ c#

In database I have next model tblWorkItem with next field: public List<xWorkItemItemFailReason> WorkItemItemFailReasons { get; set; } When I am trying

How to enable zoom in and zoom out on a contentpage in xamarin forms?

How can I enable zoom on a contentpage in xamarin forms? Is it possible to enable it on the entire contentpage? Or is it only possible to zoom in on images?

ASP.NET Core MVC (2.2) Error Middle-ware not triggering error pages

In my ASP.NET Core MVC (2.2) app I have completed the setup for a global error handling class. I inject this class in the Startup.cs of my project by using app.

How to convert a file into byte array in memory?

Here is my code: public async Task<IActionResult> Index(ICollection<IFormFile> files) { foreach (var file in files) uploaddb(file);

Error adding migration when data models are in a separate assembly

I've just setup new projects, Pegasus (my main web application) and PegasusEntities (my database objects). My Pegasus start-up code includes the following. buil

GraphQL : Not Getting EF Related objects after implementing Types

For background, I am following the tutorial here: https://www.youtube.com/watch?v=HuN94qNwQmM . As the code is too long I am putting that in git https://github.

Unable to load System.Threading.Tasks.Extensions

I have a web project build on .net framework 4.5.1. We are trying to added PostgreSQL support for the project. Using Nuget, I have installed 4.0.4 npgsql to the

System.Text.Json: How do I specify a custom name for an enum value?

Using the System.Text.Json serializer capabilities in .NET Core, how can I specify a custom value for an enum value, similar to JsonPropertyName? For example:

Visual studio keeps on popping Save as dialog box whenever I try to create or change existing table in Microsoft SQLClient

I have been trying to get rid of this problem but seems like there's no solution to this, my visual studio keeps on popping save as dialog box whenever I try to

Is the `is` operator thread-safe/atomic in C#?

Is the following code thread-safe? public object DemoObject {get;set;} public void DemoMethod() { if (DemoObject is IDemoInterface demo) { dem

Outlook VSTO plugin stops executing while iterating over contacts in default contacts folder

I wrote an Outlook plugin in which a method searches for a contact's phone number by searching the default contact folder for contacts with a specified email ad

Visual Studio C# - How do I turn off autocomplete (not intellisense)?

So I didn't use to have this issue as much in older versions, and it even then it was easy to get used to, but i got VS 2019 recently and now when I write code