Is there a difference between "double val = 1;" and "double val = 1D;"?
Is there a difference between the following two pieces of code? ``` class Test { public readonly double Val; public Test(bool src) { this.Val = src ? 1 : 0; } } class Test { ...
How to await all results from an IAsyncEnumerable<>?
I'm tinkering around with the new `IAsyncEnumerable<T>` stuff in C# 8.0. Let's say I've got some method somewhere that I want to consume: ``` public IAsyncEnumerable<T> SomeBlackBoxFunctionAsync<T>(....
- Modified
- 20 Nov at 10:16
Output logs to Xunit using Serilog Static Logger
I use serilog in my projects with the static logger approach - it's nice and easy to be able to call Log.X on my class libraries rather than injecting a logger class everywhere. However when it comes...
- Modified
- 3 Dec at 14:58
Unsupported Media Type when consuming text/plain
I receive the following response when trying to consume `text/plain`: ### Controller definition ### HTTP message I am able to consume JSON or XML just fine. What am I missing?
- Modified
- 6 May at 20:33
Unable to resolve service for type 'Swashbuckle.AspNetCore.Swagger.ISwaggerProvider'
I am starting a new `Core` Web API, and would like to add `Swagger` to my application. My current environment: - - Here is my `Startup.cs` class and configuration: ``` public void ConfigureServic...
- Modified
- 18 Nov at 07:30
Servicestack JsConfig with emitLowercaseUnderscoreNames = true does not work on properties with alphanumeric names
I am using Servicestack JsonConfig for serializing and deserializing the JSON. but for the following class, it works for some properties and does not for others. ``` public class Address { ...
- Modified
- 16 Feb at 02:41
Servicestack UnAuthorized
I am getting "The remote server returned an error: (401) Unauthorized." when using the servicestack utils to call a remote API. It requires auth basic or JWT. Calling the same API from PostMan works f...
- Modified
- 20 Nov at 03:46
IFormFile not load type Microsoft.AspNetCore.Http.Internal.FormFile' from assembly 'Microsoft.AspNetCore.Http 3.0'
When using IFormFile I am getting this error at running time: > Could not load type 'Microsoft.AspNetCore.Http.Internal.FormFile' from assembly 'Microsoft.AspNetCore.Http, Version=3.0.0.0, Culture=neu...
- Modified
- 20 Jun at 09:12
The JSON value could not be converted to System.Nullable[System.Int32]
I updated an ASP.NET Core 2.2 API to ASP.NET Core 3.0 and I am using System.Json: ``` services .AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Version_3_0) .AddJsonOptions(x => {}) ``` ...
- Modified
- 15 Nov at 22:19
The NPM script 'start' exited without indicating that the create-react-app server was listening for requests
I faced with this problem: ![enter image description here](https://i.stack.imgur.com/h8LpA.png) The NPM script 'start' exited without indicating that the create-react-app server was listening for requ...
Is it possible to use the ServiceStack templates in Visual Studio 2017 or 2019?
Is it possible to use the ServiceStack templates in Visual Studio 2017 or 2019? I've seen the documentation reference VS Code. I'm able to run the projects in VS 2019. If there is a place ask ServiceS...
- Modified
- 15 Nov at 15:40
System.Text.JSON doesn't deserialize what Newtonsoft does
I have a json that the new `System.Text.Json.JsonSerializer.Deserialize<T>(json_data)` serialize as `List<T>` with the correct numbers of elements, but then the objects inside have all the values null...
- Modified
- 27 Nov at 04:24
ServiceStack error calling Request.GetRawBody();
I am attempting to get access to the underlying JSON object (request body) within a service call in service stack. The reason I wish to do this is to create a PATCH version of an existing service, wh...
- Modified
- 15 Nov at 14:24
ServiceStack - Head Requests in Service Gateway
I have a validator that must check for the existence of another entity. I would like to be able to call the ServiceGateway, using a HEAD method, to check for the status of 404/200. . For now, I am do...
- Modified
- 15 Nov at 12:21
Clarification on how IAsyncEnumerable works with ASP.NET Web API
I encountered an interesting behavior while exploring IAsyncEnumerable in an ASP.NET Web API project. Consider the following code samples: ``` // Code Sample 1 [HttpGet] public async IAsyncEn...
- Modified
- 15 Nov at 12:12
How can I bypass the Google CAPTCHA with Selenium and Python?
How can I bypass the Google CAPTCHA using Selenium and Python? When I try to scrape something, Google give me a CAPTCHA. Can I bypass the Google CAPTCHA with Selenium Python? As an example, it's Googl...
- Modified
- 6 Feb at 12:27
Understanding the React Hooks 'exhaustive-deps' lint rule
I'm having a hard time understanding the 'exhaustive-deps' lint rule. I already read [this post](https://stackoverflow.com/questions/58549846/react-useeffect-hook-with-warning-react-hooks-exhaustive-d...
- Modified
- 1 Apr at 23:2
IDX10501: Signature validation failed. Unable to match keys
Please help me to understand the difference between JWT token validation from the ASP netcore application and the netcore Kestrel hosted application. There are two applications that verifies token us...
- Modified
- 10 Feb at 21:48
Breakpoints won't hit in Blazor Webassembly project, ASP.NET Core 3.1,
Breakpoints won't hit in ASP.NET Core 3.1, Blazor Webassembly project. I have a solution with a single Blazor Webassembly project which I run locally. When placing a breakpoint in a .cs file it says...
- Modified
- 14 Nov at 10:42
C#'s can't make `notnull` type nullable
I'm trying to create a type similar to Rust's `Result` or Haskell's `Either` and I've got this far: ``` public struct Result<TResult, TError> where TResult : notnull where TError : notnull { ...
- Modified
- 14 Nov at 08:24
get error Assets file 'obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2'
I upgrade my MVC Core Project from 2.2 to 3.0 with [microsoft](https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio) and change many recommended here...
- Modified
- 1 Jul at 08:21
How to reference System.Windows.Forms in .NET Core 3.0 for WPF apps?
I'm migrating my WPF desktop app from .NET Framework to Core 3.0. I was using System.Windows.Forms.FolderBrowserDialog() and I'm now stuck on how to add this reference to the Core project. There is no...
- Modified
- 27 Nov at 00:17
Servicestack causing invalidated the bearer token
We have a ServiceStack service being accessed by an Angular website. Randomly and we cannot identify why or when it happens, the bearer token is being invalidated. We can see the bearer token is not a...
- Modified
- 13 Nov at 19:42
Getting OData Count in ASP.NET Core WebAPI
Using the sample code from Hassan Habib's [Supercharging ASP.NET Core API with OData](https://devblogs.microsoft.com/odata/supercharging-asp-net-core-api-with-odata/) blog post, I am able to get the ...
- Modified
- 2 Dec at 12:51
Is there a way to code a for loop so that it doesn't increment through a sequence?
I have this loop: ```csharp for (int i = 1; i
- Modified
- 5 May at 16:49