Category "c++sharp"

serilog format SourceContext for showing only assembly name

I configured my project to use Serilog for logging using dependecy injection. I use the following schema in the classes constructor: namespace FlickPopper.API

Updating fields in one list from another list [closed]

Is there a better or more efficient way to do this? Both of these objects have the same Id and some similar fields that I want to update. fo

Get all MS Outlook Appointment Categories

I understand how to get the categories assigned to an individual appointment. From that, I can easily extrapolate how to get all of the categories assigned to a

How to customize migration generation in EF Core Code First?

There is a special base table type in my DbContext. And when inherited from it I need to generate an additional "SQL" migration operation to create a specific t

How do I address this MSB6006 csc.exe error (-2146232797) with VS2019?

I just updated my VS2019 community edition to Version 16.7.2. My project started failing to build (maybe link step?) with this error (it was previously buildin

Check for internet connectivity from Unity

I have a Unity project which I build for Android and iOS platforms. I want to check for internet connectivity on Desktop, Android, and iOS devices. I've read ab

How do I address this MSB6006 csc.exe error (-2146232797) with VS2019?

I just updated my VS2019 community edition to Version 16.7.2. My project started failing to build (maybe link step?) with this error (it was previously buildin

VS2019 Winforms SDK-style project, can't add a new form

VS20019 creates a windows forms project targeting .net framework (.net 4.7.2 namely) as an "old" style project. I have converted a newly created project to SDK

How to color different words with different colors in a RichTextBox while a user is writing and raise an event when that colored text is clicked

When a user writes some words in a rich text box, if that word matches some specific word, than the color of the that word should automatically change. When th

Can I Deserialize a specific field from JSON?

I am writing a method that takes a British post code and returns the Latitude and Longitude of this postcode as a "Location" object. public class Location {

check the site name hosted on IIS using code

My site name is "Flows" on IIS if i search with the name "FLOWS" its not working so is it possible that i can search it without case sensitive. class Program {

How do I see all services that a .NET IServiceProvider can provide?

This is a general question regarding .NET I am given an instance of the IServiceProvider interface, but I have little documentation as to what might be possibl

Apparently Random Error: "Antiforgery token validation failed. The antiforgery cookie token and request token do not match."

Background I have a relatively new ASP.NET Core 2 site. It's running on just one server (Windows Server 2012 R2, IIS 8.5), and I only restart the site once eve

Check if Object is Dictionary or List

Working with .NET 2 in mono, I'm using a basic JSON library that returns nested string, object Dictionary and lists. I'm writing a mapper to map this to a json

Returning default mock results from actual objects' instances

Consider a scenario when you need to write integration tests for the REST API controllers. I use MSTest for this. The logic is following: Create new database, r

What is the difference between connection.Close() and connection.Dispose()? [duplicate]

I noticed that the SQLiteConnection object in System.Data.SQLite owns two similar methods : Close() Dispose() Same for the SQLiteDataReader o

Do you have to put Task.Run in a method to make it async?

I'm trying to understand async await in the simplest form. I want to create a very simple method that adds two numbers for the sake of this example, granted, i

Returning default mock results from actual objects' instances

Consider a scenario when you need to write integration tests for the REST API controllers. I use MSTest for this. The logic is following: Create new database, r

Not able to get Costura.Fody to work, keeps asking for the DLL

I have installed costura.fody into my project using nuget package. I have updated the FodyWeavers.xml file with: <Costura Unmanaged32Assemblies='dllname' U

Identity UserManager CreateAsync does not write to database

It doesn't give any errors or warnings but it doesn't insert in the database. Seems like it's only in memory. Also UserManager's FindByNameAsync can't check use