Questions

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...

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?

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...

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 { ...

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...

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...

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 => {}) ``` ...

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...

18 Jul at 05:37

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...

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...

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...

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...

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...

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...

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...

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...

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...

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 { ...

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...

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...

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...

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 ...

2 Dec at 12:51
5 May at 16:49

C# .net core swagger trying to use Multiple API Versions, but all end-points are in all documents

We are trying to separate our API versions into different Swagger documents. We have configured everything as described in [https://github.com/domaindrivendev/Swashbuckle.AspNetCore#generate-multiple-...

2 Aug at 09:49

How to unpack msgpack record

I am using Redis and C#. I saved my user data in Redis with msgPack format. How can I deserialize msgPack data? I guess, some records are different from the current user model in Redis. I usually get ...