Questions

Method may only be called on a Type for which Type.IsGenericParameter is true after upgrading ServiceStack app to NetCore 3

After upgrading a ServiceStack based api app from NetCore 2.x to NetCore 3.0, my Angular app is receiving errors from the api when the server tries to return the response from what I can see. ``` Ser...

Reading the AuthorizationFilterContext in netcore api 3.1

I have a working netcore 2.2 project where I have implemented a custom policy that checks for API Keys. In the startup.cs I am adding this policy like this ``` //Add Key Policy services.AddAuthoriza...

27 Oct at 18:34

Bearer error - invalid_token - The signature key was not found

I have an Angular 7 application interfacing with a .Net Core 2.2 API back-end. This is interfacing with Azure Active Directory. On the Angular 7 side, it is authenticating properly with AAD and I am...

How should IPC be handled in .NET Core?

In a past .NET Framework project, our main application ran as a Windows Service and we used WCF NetNamedPipeBinding to communicate with a WPF front end application. Since WCF won't be a part of .NET ...

24 Oct at 22:11

OrmLite Condition with Nullable DateTime and DateAdd

I'm trying to accomplish `SELECT * FROM Employee WHERE EnrollmentDate > DATEADD(Month, 1, HireDate)` Unfortunately `HireDate` is nullable, and thus OrmLite will fail to generate this query. ``` va...

28 Oct at 02:25

OrmLite Select with return Type not dynamic

in a simple example like this one ``` var query = db.From<Employee>() .Join<Department>() .OrderBy(e => e.Id) .Select<Employee, Department>((employee, department) => new { emplo...

28 Oct at 02:24

Versioning for WebApi on NetCore3

I'm taking the first steps in NetCore3. I have started a default webapi project in VS.NET 2019, this has created a controller called WeatherForecastController. I have tested the webapi and this return...

5 May at 14:57

How to solve the error "Must use PackageReference"?

After adding `WindowsRuntime` to a WinForms-project, building the project fails with Error "Must use PackageReference". The build log is more precise: > C:[...]\Visual Studio 2017\Projects\Projectname...

Servicestack allow same email for multiple users

I am trying to allow multiple users to have the same email. I extended the OrmLiteAuthRepository overrode the AssertNoExistingUser but it is never called, even though i get the "duplicate email error...

24 Oct at 04:43

How to read configuration settings before initializing a Host in ASP .NET Core?

Before initializing the application Host I need to read some settings from the application's configuration to setup some other things. In ASP .NET Core 2.x to read settings before initializing the ap...

28 Oct at 15:48

Is there a general Logging service on Azure?

Maybe SO isn't the right place for this question. If there is a better platform, please let me know and I will post it there. Within a single product/domain, we have multiple Azure-hosted application...

23 Oct at 19:3

C#: Converting List of Chars to String

I'm solving a coding challenge on Coderbyte with C# using lists. I have the desired outcome but need to return it as a string. I would like to know how to convert my list of chars into a string. Than...

23 Oct at 13:50

Swagger not working inside Docker in .Net core project?

net core Web API application. I have created swagger with Azure AD authentication. My swagger properly works when I am using IIS. When I run using docker I get This site can’t be reached. Below is my ...

Print FixedDocument/XPS to PDF without showing file save dialog

I have a `FixedDocument` that I allow the user to preview in a WPF GUI and then print to paper without showing any Windows printing dialogue, like so: ``` private void Print() { PrintQueueCollect...

9 Nov at 14:58

Should Program class be static?

I am getting the following Warning in Visual Studio 2019, after creating a new ASP.NET Core 3 project: Warning CA1052 Type 'Program' is a static holder type but is neither static nor NotInheritable ...

22 Oct at 22:21

How to deserialize stream to object using System.Text.Json APIs

I'm receiving a response from a web api call as a stream and need to deserialize it to a model. This is a generic method, so I can't say which parts of code will use this and what's the response paylo...

27 Oct at 19:17

.NET Core The namespace internal does not exist in Microsoft.Extensions.Logging.Internal

I have a .Net core 2.1 project that was using the `Microsoft.Extensions.Logging.Internal` namespace, specifically `FormattedLogValues` class. I am now migrating to .Net core 3, I couldn't find a piece...

6 May at 05:43

How to make a HTML text multiline using a C# bind in a blazor project?

I have a `Blazor` project with a ClientSide Razor Page. On that page I want to show a multiline text, for example: But the text is found in a C# string using a `@bind`. I have tried using the nor...

22 Oct at 07:55

Change property type as exported by Swagger/Swashbuckle

I have a fairly complex object with nested objects; please note that in the example below I have simplified this object greatly. Assume the following example object: ``` public class Result { pu...

21 Oct at 15:45

What does a single quote inside a C# date time format mean?

We have e.g. this constant in C#: ``` System.Globalization.DateTimeFormatInfo.InvariantInfo.SortableDateTimePattern ``` It has this value: ``` "yyyy'-'MM'-'dd'T'HH':'mm':'ss" ``` I do use it in ...

Returning a custom HTTP response code when the authentication fails for a custom credentials auth provider

I know that I can return a custom reponse when using a custom authentication provider like the code below: [Return a custom auth response object from ServiceStack authentication](https://stackoverflo...

21 Oct at 14:4

Select box binding in blazor

I am trying to bind `CountryId` in the model to the value of a selected item of `SelectList` in Blazor. All of the Country items come in a list like `{CountryId, CountryName}` object. I do the code li...

30 Dec at 21:55

no matches for kind "Deployment" in version "extensions/v1beta1"

While deploying mojaloop, Kubernetes responds with the following errors: > Error: validation failed: [unable to recognize "": no matches for kind "Deployment" in version "apps/v1beta2", unable to reco...

13 Jan at 13:58

NotImplementedError: Cannot convert a symbolic Tensor (2nd_target:0) to a numpy array

I try to pass 2 loss functions to a model as [Keras allows that.](https://keras.io/models/model/) > loss: String (name of objective function) or objective function or Loss instance. See losses. If the...

ASP.NET Core 3.0 System.Text.Json Camel Case Serialization

In ASP.NET Core 3.0 Web API project, how do you specify [System.Text.Json](https://learn.microsoft.com/en-us/dotnet/api/system.text.json?view=netcore-3.0) serialization options to serialize/deserializ...

18 Dec at 15:27