Questions

Migrating .net framework to .netcore 3.1 (Servicestack.Razor Views)

I'm migrating a .net framework web to .netcore Having issues with moving the 'Views' folder. It seems that every razor page with `@inherits ViewPage<TModel>` I get an error `"The type or namespace 'Vi...

Error: Each parameter in constructor must bind to an object property or field on deserialization

i'm trying to send data to save it in my db, basic, so i send a model to my controller, and i get this error: "Each parameter in constructor 'Void .ctor(SmgApi.Models.Entity.EquipmentEntity)' on type ...

22 Jul at 12:31

How to inject IHttpClientFactory in Container servicestack.net?

I'm working on a solution that interacts with Redis, using the servicestack.net library. I have a class that inherits from ServiceStack.AppHostBase and asks me for an override of the Configure method....

21 Jul at 15:19

Servicestack orm lite does not deserialize neasted json structures

I have a pgsql view which returns list of records. One field of record is represented as json and deserialised to property `List<ClassA> ClassAItems`. However `ClassAItems` has also `List<ClassB> Clas...

C# OrmLite v5.11.0 SqliteOrmLiteDialectProvider class throwing a compiler error

I'm trying to write a Sqlite in-memory database in C# using `ServiceStack.OrmLite` version 5.11.0 [based on the follow article from 2016](https://mikhail.io/2016/02/unit-testing-dapper-repositories/) ...

Token cache serialization in MSAL.NET is not working

I am facing some issues when trying to serialize the tokencache, returned from authenticating with MSAL. I would appreciate any help, since i don't really understand what i am doing wrong. Here is our...

Download File from Server with Blazor App

I have created an `HttpGet` in my Server-API which creates a CSV-File and returns it with `FileStreamResult`: ``` [HttpGet] public IActionResult Get() { // do logic to create csv in memoryStream ...

15 Jul at 16:11

How to run .NET Core Console app using generic host builder

I am trying to figure out how to use hostbuilder pattern to run a console app (not a windows service). Intent is to keep the flow as similar to a WebApi to keep development practices similar. I have s...

Android Studio error "Installed Build Tools revision 31.0.0 is corrupted"

I'm on Android Studio 4.2.2. I created a new project and haven't added anything to the starter code and whenever I click , I get this error: > Installed Build Tools revision 31.0.0 is corrupted. Remov...

servicestack sql server keyword not supported ormlite

I'm using servicestack in an api c# project and have referenced the - - nuget packages. I can connect to sql server as expected. We are now trying to implement Always Encrypted colums in some of our ...

Is there a way to declare Routes somewhere else than above Request DTOs?

I am new to ServiceStack and I have been tasked with optimizing/cleaning up our current setup with ServiceStack. We have a relatively extensive website built (meaning 60+ endpoint locations), and I wa...

19 Jul at 18:39

Azure Function Middleware: How to return a custom HTTP response?

I am exploring Azure Function running on `.net 5` and I found out about the new [middleware capabilities](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.middlewareworkerappl...

Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'Controller'

I am trying to implement Application Insights logging. Here is my startup Under configureservices ``` services.AddApplicationInsightsTelemetry(Configuration["ApplicationInsights:InstrumentationKey"]);...

Cannot run WebApp in .Net

So I created a new web app using $x new web WebApp in my cmd and when I open the .sln file in VS and go to press run I get this page: [](https://i.stack.imgur.com/q2fwD.png) But what I want is this: [...

11 Jul at 10:39

Using ServiceStack Client with Case Sensitive REST Service

My code is using a `DataContract` with `DataMember` in the response DTO and I'm attempting to consume a REST service with this response but it's not working: ``` { "results": { "p": 277.76, "s": ...

10 Jul at 00:36

What is the best practice to call Async method from Sync method?

I know some people will argue "why don't you just make SyncMethod() to async method?". We wish, but in a real world, sometimes we have to keep SyncMethod the way it is for backwards compatibility reas...

error: NU1100: Unable to resolve 'MicrosoftOfficeCore (>= 15.0.0)' for 'net5.0'

In Terminal of Visual Studio Code, when I try to run: ``` dotnet add package MicrosoftOfficeCore --version 15.0.0 ``` I get the following error on Visual Studio Code terminal: ``` error: NU1100: Unab...

ServiceStack Different Security based on routes

We have a ServiceStack host, in which we have modularised the services. In addition we have a custom authentication solution based on the Basic Authentication. But what we would like to do is have di...

7 Jul at 08:10

Why is ServiceStack JwtAuthProvider being invoked when service is specified to authenticate with GithubAuthProvider?

Exploring the `ServiceStack` authentication providers for the first time. Have gradually built up a test project by adding `BasicAuthProvider` and when that worked, added `GithubAuthProvider`. The las...

7 Jul at 04:41

Why C++ forces initialization of member variables to be in the order of the declaration

I know that in C++ the declaration of members in the class header defines the initialization order. Can you tell me why C++ choose this design? Are there any benefits to force the initialize order ins...

Why does an interface's default implementation get called when two classes are in the inheritance chain, and the class in the middle is empty

## Summary I have found that inserting a class between an interface and another derived class results in the interface's default implementation being called rather than the derived implementation f...

29 Jun at 21:10

CUDA error: device-side assert triggered on Colab

I am trying to initialize a tensor on Google Colab with GPU enabled. ``` device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') t = torch.tensor([1,2], device=device) ``` But I am get...

28 Mar at 12:32

SoapHttpClientProtocol equivalent in .NET Core

I'm trying to invoke a soap web service from .NET Core. I've built the proxy using `dotnet-svcutil` and found it's a lot different from an older .NET 4.6 implementation of the same endpoint. The .NET ...

28 Jun at 14:58

Functional programming and decoupling

I'm your classic OOP developer. However since I discovered purely functional programming languages I've been ever intrigued to the since OOP seemed to solve most business cases in a reasonable manner...

Select multiple tables and custom column to POCO

I have an export query that returns multiple tables with a lot of columns. ``` var q = db.From<Blog>() .Join<Blog, UserAuthCustom>((b, u) => b.UserAuthCustomId == u.Id) .Join<UserAuthC...

27 Jun at 02:45