What makes ValueTuple covariant?
This compiles correctly in C# 7.3 (Framework 4.8): ``` (string, string) s = ("a", "b"); (object, string) o = s; ``` I know that this is syntactic sugar for the following, which also compiles correc...
- Modified
- 19 Dec at 14:7
System.MethodAccessException: 'Attempt by method 'Microsoft.Extensions.Logging.Configuration issue
In .NETCore, While running the application in `Program.cs` file at `CreateWebHostBuilder(args).Build().Run();` I'm getting the Exception > "System.MethodAccessException: 'Attempt by method 'Micr...
- Modified
- 19 Dec at 07:2
How Do You Access the `applicationUrl` Property Found in launchSettings.json from Asp.NET Core 3.1 Startup class?
I am currently creating an Asp.NET Core 3.1 API Application. In it, I have a `launchSettings.json` that looks like the following: ``` { "iisSettings": { "windowsAuthentication": false, "an...
- Modified
- 18 Dec at 21:48
C# 8 base interface's default method invocation workaround
According to [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/default-interface-methods](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/prop...
- Modified
- 18 Dec at 18:20
editorconfig - how to specify underscore prefix for readonly private fields?
I haven't been able to find anything on this online. Is there any way to specify that an underscore prefix for readonly private fields should be added? Ever since I started using an `editorconfig` f...
- Modified
- 18 Dec at 14:34
Generate NSwag client as part of the build
I have a project that uses NSwag to generate a client and the contracts from a swagger file. I don't want these generated files to be tracked by git, so that when the project is built on the build ser...
- Modified
- 11 Sep at 11:18
Test Explorer (VS) shows '<Unknown project>'
Everthing below is made in VS2019, using .NET Framework 4.7 and NUnit + NUnit3TestAdapter I created an assembly called Exitus.Tests, and added a few unit tests. However, do to some issues with Nuget,...
- Modified
- 18 Dec at 12:24
Allow anonymouos access to healthcheck endpoint when authentication fallback policy is set in ASP.NET Core 3
asp.net core 3 allows to set to make the endpoints secure by default: ``` services.AddAuthorization(options => { options.FallbackPolicy = new AuthorizationPolicyBuilder()...
- Modified
- 18 Dec at 08:15
Correct way to mutate a component property in blazor
I have two components, `Child.razor` and `Parent.razor`. The `Child.razor` HTML: ``` <input type="text" value="@Text" /> ``` The `Child.razor` C#: ``` [Parameter] public string Text { get; set; }...
- Modified
- 17 Dec at 22:53
Include with FromSqlRaw and stored procedure in EF Core 3.1
So here's the deal - I am currently using EF Core 3.1 and let's say I have an entity: ``` public class Entity { public int Id { get; set; } public int AnotherEntityId { get; set; } publi...
- Modified
- 17 Dec at 20:18
OData on .Net Core doesn't return the right results on $select
I've added OData to my WebAPI project. Versions: 1. Core 3.1 2. OData 7.3.0 (beta version in order to work with Core 3.x) 3. EF Core 3.1.0 Here is my startup.cs ``` public class Startup { ...
- Modified
- 18 Dec at 09:10
Best way to implement sort, search & pagination with Redis for maximum performance
I have large data approx 1,00,000 for employee. I have stored this data to one Redis key called "employess". Now there is one screen where I would like to perform search on some field & sort on each c...
- Modified
- 19 Dec at 16:48
Convert IAsyncEnumerable to List
So in C#8 we got the addition of the `IAsyncEnumerable` interface. If we have a normal `IEnumerable` we can make a `List` or pretty much any other collection we want out of it. Thanks to Linq there....
- Modified
- 17 Dec at 18:57
What is @context and why is it red?
I'm using the `BlazoredTypeahead` component in a blazor server side app and I'd like to know where the @context keyword is coming from. The following code runs fine, but VS is reporting that it Cannot...
Does JsonStringEnumConverter (System.Text.Json) support null values?
I am shifting my code from .NET Core 2.x to .NET Core 3.x (i.e. use the native library `System.Text.Json`). In doing this, I ran into some issues with how the former `Newtonsoft.Json` support for null...
- Modified
- 1 Jan at 15:50
C# 8 Using Declaration Scope Confusion
With the new C# 8 Using Declaration Syntax, what is containing scope of a second consecutive using statement? Previous to C# 8, having a consecutive using statement like: ``` using(var disposable ...
- Modified
- 7 Jan at 16:1
How to install Nuget package using windows command line in C# project?
I have downloaded NuGet version - 5.1.0 and tried to install one of the package - log4net using cmd. it failed. below is error - > Microsoft Windows [Version 10.0.19042.1348] (c) Microsoft Corporat...
- Modified
- 3 May at 05:9
How to use System.HashCode.Combine with more than 8 values?
.NET Standard 2.1 / .NET Core 3 [introduce](https://github.com/dotnet/corefx/issues/14354) [System.HashCode](https://learn.microsoft.com/en-us/dotnet/api/system.hashcode) to quickly combine fields and...
- Modified
- 17 Dec at 13:18
Visual Studio unable to run .NET Core tests
Using the latest version of Visual Studio, I'm unable to run any tests in the tests explorer. The error message in the `Tests` output window is: ``` Testhost process exited with error: It was not pos...
- Modified
- 18 Dec at 00:4
Is this pattern matching expression equivalent to not null
I stumbled upon [this code](https://github.com/devmentors/Nanoservice/blob/37f5e3afee84dabefad654495ea0839e90032200/src/Sidecar/Program.cs#L71) on github: ``` if (requestHeaders is {}) ``` and I do...
Publish Single File (Release) fails for WPF .NET Core 3.1 application
I'm trying to publish a WPF Application (to a folder) targeting .NET Core 3.1, using Publish Single File, targeting win-x86. The application publishes fine for Debug, but fails for Release. If I desel...
- Modified
- 16 Dec at 13:37
How to Upload File from Angular to ASP.NET Core Web API
Similar questions have been asked but after looking through all of those and many blog posts on the subject I have not been able to figure this out so please forgive me. I am creating a simple blog w...
- Modified
- 16 Dec at 01:36
Equivalent of UseUrls for .NET Core IHostBuilder
Previously, with .NET Core, I could add `UseUrls` to my `Program.cs` file to set the URL that the web server would run on: However, in .NET Core 3.1, the default format of `Program.cs` changed: I trie...
- Modified
- 6 May at 05:43
No handles with labels found to put in legend
I'm trying to create a parallelogram in PyPlot. I'm not up to drawing the parallelogram--first I'm putting in the vector arrows--using the following code: ``` fig = plt.figure() ax = fig.add_subplot(1...
- Modified
- 12 Jul at 17:52
Error occurred while access Microsoft.Extensions.HostingServices. Could not parse JSON file
I was trying to create a migration for an MVC ASP.NET Core 3.10 project using Visual Studio 2019. I got two errors: 1. An error occurred while accessing the Microsoft.Extensions.Hosting services. Co...
- Modified
- 15 Dec at 18:2