1

I am using Visual Studio 2017. I have a Framework 4.6.1 console application referencing ServiceStack.Client.Core v5.1.0. It also references four other Standard 2.0 DLL projects in the same solution, and these projects also referencing ServiceStack.*.Core v5.1.0 assemblies. All ServiceStack packages were downloaded with NuGet.

My console app will not compile. Every line of code that tries to instantiate the JsonServiceClient throws several compile time errors:

using (var client = new JsonServiceClient(AppSettings.BaseUri))

The type 'IMessageProducer' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'.
The type 'IJsonServiceClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'.
The type 'IServiceClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'.
....

No project in this solution references a non-Core 5.1.0 ServiceStack package. So why would I get errors asking me to reference an older non-Core ServiceStack assembly?

ADDENDUM: If I revert all the ServiceStack packages to version 5.0.2, then it compiles!

(Possibly related to previous question)

1 Answers1

0

This definitely sounds like a dependency/reference issue of which if you're running a .NET Core App on the .NET Framework you can only reference the .Core NuGet packages. There's not enough info to be able to repro the issue so I'd first look at clearing your /bin and /obj folders and clearing your NuGet cache to get back to an empty slate, e.g:

$ nuget locals all -clear

If that doesn't work, use one of the existing ASP.NET Core on .NET Framework Templates so you can start from a working configuration.

A project with minimal dependencies is selfhost-corefx which can be installed with:

Install dotnet-new:

$ npm install -g @servicestack/cli

Create a project from the template:

$ dotnet-new selfhost-corefx ProjectName
mythz
  • 141,670
  • 29
  • 246
  • 390