Category "c++sharp"

Using .StartsWith in a Switch statement?

I'm working on a Switch statement and with two of the conditions I need to see if the values start with a specific value. The Switch statement does like this. T

How to show a pop up message with dark background

I'm going to show a error message in my program . I'd like my messages to be like image below, as you can see, I need a dark shadow to be shown when message

Does .Net contain a built in Line Endings conversion which checking input format [duplicate]

I'm getting a string from an external native library function which uses "\n" for line separation. I simply want to write this to disk using t

WPF nested data binding to control - why does it not work

I have searched google and stackoverflow alot to find a answer to my question without any luck. I find the solution to the problem. Ex: Data Binding to Nested

Request.Content.IsMimeMultipartContent() fails

I'm trying to upload a file using the Html2 input type="file" and an angular2 http.post request. When the request reaches the web api, it fails in the Request

Create empty array using reflection [duplicate]

How do I create empty array of a type given by reflection? I have tried using the Activator.CreateInstance(Type) method: Type arrayType = typ

SSIS using Script task - Convert XLS to CSV

I am using C# script task component to convert XLS to CSV file , my entry point is set to ScriptMain But I am constantly getting error "Error: Cannot execute s

Forming Json Format String

I am using this method to form json string and this is working fine. But i can't handle this if it contains more properties. Is there any other better method th

How do I check for overflow after an Interlocked.Increment in C#?

What is the correct way to check for an overflow after a call to Interlocked.Increment? I have an ID generator that generates unique ids during the program's ex

While loop program flow

I'm having trouble with my program flow in a while loop I created. while (reader.Read()) { // Store scenario information int Id = (int)reader["Scenario

RestSharp - Authorization Header not coming across to WCF REST service

I am trying to call a locally hosted WCF REST service over HTTPS with basic auth. This works and the Authorization header comes thru just fine and all is happy

How to get a duration of mp3 file via .NET/C#? [closed]

I need to create a M3U playlist of mp3 songs. Is there any way to read the duration attribute of MP3 files?

How to specify the first day of week in Outlook RecurrencePattern of AppointmentItem?

In OOM, is there a way to specify the assumed first day of the week, like WKST parameter in ICS RULE section? When I save a calendar from Outlook, I see that i

The type initializer for "Crystaldecisions.crystalreports.engine.reportdocument" threw an exception

I have been developing Crystal Reports for a while now and the software application is running perfect but got this error again the type initializer for "crysta

How to Replace DTE2 in .NET Standard

It's been a while since .NET Standard is introduced by Microsoft. Earlier, if I wanted to obtain information about Project, Solution and other related objects (

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