How to provide mock values in a FeedResponse for CosmosSDK v3+?
I'm writing a data access layer for my application and trying to mock out the CosmosDB SDK dependency for unit testing. I am using NUnit with NSubstitute and have come across the issue where I am tryi...
- Modified
- 5 May at 16:49
'Could not find file ... bin\roslyn\csc.exe'
In Visual Studio 2017, when hitting + to run my ASP.NET Framework Web API server, I get: ``` Could not find file ... bin\roslyn\csc.exe: ``` [](https://i.imgur.com/sohAXxi.png) Running `Update-Packag...
- Modified
- 29 Jun at 17:12
System.InvalidCastException: 'The SqlParameterCollection only accepts non-null SqlParameter type objects, not SqlParameter objects.'
I migrated my project from ASP.NET Core 2.2 to ASP.NET Core 3.0. Now I get this exception. In ASP.NET Core 2.2 it was using `FromSql()`; now it is using `FromSqlRaw()`. I am calling my procedure using...
- Modified
- 13 Apr at 01:16
ASP.NET Core 3.0 [FromBody] string content returns "The JSON value could not be converted to System.String."
Using `[FromBody]` string content on an `ApiController` in ASP.NET Core 3.0 returns a validation error: ``` {"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title":"One or more validat...
- Modified
- 2 Dec at 14:45
Is there a System.Text.Json's substitute for Json.NET's JsonProperty(Order)?
Since `System.Text.Json` is now JSON lib for [.NET Core 3.0](https://learn.microsoft.com/en-us/dotnet/api/system.text.json?view=netcore-3.0), is there an attribute/param matching Json.NET's [JsonProp...
- Modified
- 9 Dec at 14:32
How to use class fields with System.Text.Json.JsonSerializer?
I recently upgraded a solution to be all .NET Core 3 and I have a class that requires the class variables to be fields. This is a problem since the new `System.Text.Json.JsonSerializer` doesn't suppor...
- Modified
- 25 Nov at 23:24
Running actions in another directory
I've just started exploring Github actions however I've found myself placing a command in multiple places. I have a PHP project where the `composer.json` is not in the root, my structure looks like:...
- Modified
- 28 Sep at 10:29
System.Text.Json.JsonElement ToObject workaround
I want to know the equivalent of the `ToObject<>()` method in [Json.NET](https://www.newtonsoft.com/json/help/html/Introduction.htm) for . Using Json.NET you can use any `JToken` and convert it to a c...
- Modified
- 10 Aug at 14:32
Client side GroupBy is not supported
I have the following Entity Framework Core 3.0 query: ``` var units = await context.Units .SelectMany(y => y.UnitsI18N) .OrderBy(y => y.Name) .GroupBy(y => y.LanguageCode) .ToDictionaryAsync(...
- Modified
- 20 Mar at 18:12
ServiceStack.RequestFilterAsyncAttribute error: System.ArgumentNullException: Value cannot be null. Parameter name: method
I got runtime error and also find a way to fix (in the end). Just curious why cannot use public property for constructor. `RequestFilterAsyncAttribute` or `RequestFilterAttribute` doesn't matters, btw...
- Modified
- 29 Sep at 02:38
How to create a signing certificate and use it in IdentityServer4 in production?
Most (all?) the sample code on the [IdentityServer4 docs site](https://identityserver4.readthedocs.io/en/latest/) uses `AddDeveloperSigningCredential()`, but recommends using `AddSigningCredential()` ...
- Modified
- 6 Oct at 03:15
How to configure client for access with authsecret?
I'm using the client and I need to call a service using authsecret parameter. If I ad this param to the base url it give me a serialization error. ``` String baseUrl = AppConfig.GetAppApiUrl(); var c...
- Modified
- 30 Sep at 07:30
'ConfigureServices returning a System.IServiceProvider isn't supported.'
I need ti use this `AutoFac` in ASP core 3.0 When I use this code in startu up: ``` public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddControllers(); return...
- Modified
- 27 Sep at 11:31
Has been compiled by a more recent version of the Java Runtime (class file version 57.0)
I get this problem Using IntelliJ. But I have the newest version of everything newly installed on my system. I've set: PATH as C:\Program Files\Java\jdk-13 JAVA_HOME as: C:\Program Files\Java\jdk-...
- Modified
- 26 Sep at 23:38
Grpc .Net client fails to connect to server with SSL
Unable to connect to the greeter grpc service mentioned in this link - https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.0 from a greeter client which is writte...
When to use JSX.Element vs ReactNode vs ReactElement?
I am currently migrating a React application to TypeScript. So far, this works pretty well, but I have a problem with the return types of my `render` functions, specifically in my functional component...
- Modified
- 28 Sep at 18:19
IIS Custom field logging through HTTP Request in ASP NET Core
I have enabled IIS logging with custom fields for my website. [](https://i.stack.imgur.com/F6bNb.png) Previously in MVC, I have used HTTPHandlers and Module to add the above fields to the HTTP Requ...
- Modified
- 27 Sep at 05:12
Store computed property with Entity Framework Core
I'll try and illustrate my question with an oversimplified example: Imagine I have a domain entity like this: ``` public class Box { public int Id { get; set; } public int Height { get; set; ...
- Modified
- 26 Sep at 12:52
What is the difference between an interface with default implementation and abstract class?
C# 8.0 has introduced a new language feature – default implementations of interface members. ``` public interface IRobot { void Talk(string message) { Debug.WriteLine(message); } ...
- Modified
- 26 Sep at 13:7
How to set hosting environment name for .NET Core console app using Generic Host (HostBuilder)
I am setting up a .NET Core 2.x console app as a Windows service and need to load an appsettings json file based on the environment. I was thinking to start the service with a command line argument t...
Formatting DateTime in ASP.NET Core 3.0 using System.Text.Json
I am migrating a web API from .NET Core 2.2 to 3.0 and want to use the new `System.Text.Json`. When using `Newtonsoft` I was able to format `DateTime` using the code below. How can I accomplish the ...
- Modified
- 26 Nov at 00:54
IHostBuilder does not contain a definition for ConfigureWebHostDefaults
I'm trying to use the new `GenericHost` in documented [here](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-3.0) but I'm getting a really basic error tha...
- Modified
- 11 Mar at 05:26
What's the difference between ASP.NET Core Hosted and Server-Side Blazor, really?
I'm still struggling to understand the difference between and Blazor. I know same question already [exists](https://stackoverflow.com/questions/53332097/blazor-asp-net-core-hosted-vs-server-side-in-...
- Modified
- 20 Jun at 09:12
How to pass a parameter to razor component in server-side Blazor?
How can I pass parameter into razor component? So far I tried ``` @(await Html.RenderComponentAsync<Rateplan>(RenderMode.ServerPrerendered, new { id= 100})) ``` But I receive an error > InvalidOp...
- Modified
- 14 Nov at 10:7
Identity asp.net core 3.0 - IdentityDbContext not found
My app broke with the 3.0 release of .NET core with reference errors for `IdentityDbContext`. I'm looking through documentation for Identity on core 3.0 but it implies that IdentityDbContext should b...
- Modified
- 25 Sep at 01:56