Where is full documentation about the csproj format for .net core?
Is there a full documentation about the csproj format for .net core projects? I was looking for a way to copy files before building. After some searching I found a solution, but I can't find the docu...
Inspect server certificate using HttpClient
I'm rewriting some web handling code in WinForms and switching from HttpWebRequest to HttpClient. There's one last thing I require that I cannot seem to find out how to accomplish. In HttpWebRequest, ...
- Modified
- 7 May at 05:54
How to return 403 Forbidden response as IActionResult in ASP.NET Core
I would like to return a 403 Forbidden to the client when trying to perform a restricted operation. What is the method I need to use? I searched over the internet but I found only these for MVC 5: > I...
- Modified
- 24 Feb at 12:42
How to Invert Color of XAML PNG Images using C#?
I'm using Visual Studio, C#, XAML, WPF. In my program I have XAML buttons with white png icons. [![enter image description here][1]][1] I want to have it so you can switch to a theme with black icons ...
- Modified
- 6 May at 18:47
RDLC report stop working after change Visual Studio 2015 to Visual Studio 2017
I have an AspNet MVC project in Visual Studio 2017 that was previously developed in Visual Studio 2015. This project contains many that were working fine until I edited one of them. Now, when I try t...
- Modified
- 13 Jul at 20:37
How to return async HttpClient responses back to WinForm?
Up until now, I've been making synchronous HttpWebRequest calls in WinForms applications. I want to start doing it asynchronously so as to not block the UI thread and have it hang. Therefore, I am att...
- Modified
- 7 May at 05:55
Why are C# references added differently between NuGet and Visual Studio
We use NuGet (NuGet Version: 3.5.0.1996) two different ways. Either we run it from the command line or we use the NuGet Package Manager in Visual Studio (2015). The problem is that these two ways ad...
.Net Core Model Binding JSON Post To Web API
Just started a new project using .NET Core. Added my Web API controller and related method. Using Postman I created a JSON object and posted it to my controller method. Bear in mind the JSON object ma...
- Modified
- 24 Oct at 14:26
MySql.Data.MySqlClient.MySqlException: “The host localhost does not support SSL connections.”
I use MySql.Data 8.08 and .NET Core to connect to MySql 5.7.18 but following exception is being thrown: `MySql.Data.MySqlClient.MySqlException:“The host localhost does not support SSL connections.”`...
- Modified
- 15 Apr at 21:55
Prevent Windows 10 from automatically restarting after an update programmatically
We work on "mission-critical" software that runs in Windows. In general, it is bad if a Windows automatic update interrupts our process as it can mean lost money in scrapped material (you cannot s...
Servicestack getAsync explanation
I'm quite new to webservices and rest, and I'm currently playing around with servicestack. I have the following code, which works: ``` var response = client.Get<MeasurementResult>(SettingsManager.ge...
- Modified
- 13 Jul at 09:47
Send email as calendar invite/appointment in SendGrid C#
I would like to send an email with calendar invite/appointment to both Outlook as well as non-Outlook client like gmail/yahoo. My application is hosted on Azure and I am using SendGrid for sending ema...
The 'Content-Type' header must be modified using the appropriate property or method. Parameter name: name
Hi I am using HttpWebRequest GET method to call a REST service. I am getting error :- ***'Content-Type' header must be modified using the appropriate property or method. Parameter name: name.***i che...
- Modified
- 13 Jul at 09:17
ServiceStack with Razor - Model is null (deployed to Azure)
When using ServiceStack / Razor, I'm having issues rendering a view in Azure only. [http://nehcr-dev.azurewebsites.net/with-view](http://nehcr-dev.azurewebsites.net/with-view) Here is a screenshot ...
- Modified
- 12 Jul at 20:56
Can not delete \bin\roslyn\VBCSCompiler.exe - Access is denied
I am facing a strange issue from roslyn compiler. Sometimes when I build the solution I face a strange issue in error list which does not let me build the solution. Here is the error: > Severity Co...
- Modified
- 12 Jul at 18:51
Execute SSRS Report from C# save as PDF
So, here's my delema. The title says it all. I cannot seem to find any guidance on how to execute a SSRS report remotely and save it as a PDF. I have tried to follow the below article. [Using Report...
- Modified
- 12 Jul at 17:46
Visual Studio 2017 Unexpected Character '
So I had 2 weird system crashes, shall I say restarts. I tried to troubleshoot but i could't find any problem. Soon after I went into VS 2017 to practice a bit and this occurs. Error: > C:\Users\Sh...
- Modified
- 12 Jul at 20:15
List Index Out of Range exception when creating a task
The exact error: > Index was out of range. Must be non-negative and less than the size of the collection. I've index arrays and lists countless times. I've used for loops with arrays and lists count...
- Modified
- 24 Jul at 06:39
Bind an IConfigurationSection to a complex object without ASP.NET Core
I have a .NET Core console application and want to read the `appsettings.json` and parse a section as `List<Param>` (without Dependency Injection or ASP.NET Core). I already tried [How do I bind a mul...
- Modified
- 8 Jun at 01:27
Missing project dependency when referring project
I'm facing some issues with dependencies when referring projects in Visual Studio. Here is how my solution is structured: - - - The console application is working as expected, but when running th...
Detecting/Diagnosing Thread Starvation
I am doing some performance/scalability testing of an IIS application that occasionally seems to slow down to a crawl in production. I'm able to reproduce the slowness consistently using NUnit. CPU...
- Modified
- 11 Jul at 15:7
How to serve a Redis MQ requests that depends on User session in servicestack
I was looking for a better approach to solve the the following scenario. My API endpoints are currently using Usersession variables while processing the request. This becomes a problem when we have t...
- Modified
- 11 Jul at 13:48
How to run migration SQL script using Entity Framework Core
I faced with an issue, where I can't reach the SQL script to apply the migration. Here is my migration code: ``` public partial class AddSomethingMigration : Migration { private const string MI...
- Modified
- 21 Sep at 13:3
How to replace Assert.Fail() with FluentAssertions
We are currently converting some code that was using `Assert.IsTrue()`, `Assert.AreEqual()`, `Assert.IsNotNull()`, etc. The basic unit test assert Library for C# We want to use FluentAssertions, like...
- Modified
- 11 Jul at 13:38
How to correctly block on async code?
I have tons of code written in following manner: ``` public string SomeSyncOperation(int someArg) { // sync code SomeAsyncOperation(someArg, someOtherArg).ConfigureAwait(false).GetAwaiter().Ge...
- Modified
- 12 Jul at 12:5