Currently working on a new version of a solution. I thought I’d jump in and use .NET Core 2.0 and v5 for the backend code so it’s portable amongst different operating systems.
My problem is that when I attempt to use the .NET JsonServiceClient in my test program (.Net Framework 4.6.1), I get an error message stating a reference is required to ServiceStack.Interfaces 5.0.0. I tried to change it to use ServiceStack.Client.Core however I then get an exception that a method is missing in HttpUtils.
Breakdown of frameworks:
Main Service: .NET Core 2.0 (runs fine)
ServiceModel: .NET Standard 2.0 (seems to be fine)
Test Program: .NET Framework 4.6.1 (has issues)
Is this even possible? It’s new to me all these variations! Thanks for your time.
I’ve checked the ServiceStack.Text.dll in both ServiceStack.Text and ServiceStack.Text.Core packages and they all have a HttpUtils.HasRequestBody(string httpMethod) defined so I’m assuming you’re using an old .dll somewhere.
Ok, I cleared the cache and I started to get another error message about mismatch and PUBLIC KEY TOKEN.
I worked out I needed to use the ServiceStack.Client.Core package to work with the .Net standard ServiceModel projects I had. However, I can’t seem to find a way to use MsgPack with the core packages? The core package seems to be deprecated and the normal ServicePack.MsgPack wants to bring the non-working libraries.
Am I missing something? Really sorry, this core/standard stuff is all very new to me!
There is no .NET Standard only .Core package for MsgPack, they only exist for the ServiceClient projects. You’ll either need to remove the binary coupling by using the source-only copy of your DTOs with Add ServiceStack Reference or have the Service Model projects create .NET Standard + .NET Framework builds with:
Hello,
I am getting same error (Missing reference on ServiceStack.Interfaces 5.0.0) when trying to reference .net Standard 2.0 from .Net 4.6.1 framework.
I tried to clear nuget cache but still the same error.
Please make sure you’ve read this thread and the docs on what’s supported, i.e. a you can force the reference of .NET Standard client packages from .NET Framework, but you can’t run .NET Standard Server libraries from .NET Framework.
You’re not “trying to reference .net Standard 2.0 from .Net 4.6.1 framework” you’re creating 2 separate builds, where the net461 framework build will be referencing .NET Framework versions and the netstandard2.0 build will be referencing .NET Standard versions.