Hello Everyone,
I am running xunit tests from a .netcore class library. Today I started receiving this error and I am completely stumped. I did recently renew my licence, don’t think it would be related. I’ve tried using a binding redirect in app.config to no avail. I don’t necessarily think that this is actually related to ServiceStack directly, wondering if anyone has ever experienced this. I’m using VS2017 so no project.json, I’ve added the PackageTargetFallback to the project file. These tests were all running (honestly ;)) last week.
Any help or ideas would be greatly appreciated,
ian
[xUnit.net 00:00:00.7756535] -------- System.TypeInitializationException : The type initializer for ‘ServiceStack.PclExport’ threw an exception.
[xUnit.net 00:00:00.7756831] ------------ System.IO.FileNotFoundException : Could not load file or assembly ‘System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. The system cannot find the file specified.
You can try adding explicit references to System.Net.Http and System.Net.Primitives to see if that helps.
Otherwise we’ve just converted all our source projects to use VS2017 new multi-platform targeting build system, so maybe if you use the new v1.0.41 builds of .NET Core on MyGet it will just magically work
Thanks for the ideas. I must be in one of the very deep hate cycles in my love hate relationship with Visual Studio. I added the explicit references, didn’t work, so I removed them…hit rebuild just cause I felt like hitting something and suddenly bingo, all errors and warnings gone! Hit run tests and I’m back in business. The switch to .net core has been really challenging with tooling, changes…unchanges, thanks for putting the work in on your guys’ end, haven’t really had any majors with the ServiceStack framework itself under .netcore which has been one of my popular selling features when evangelizing it to others!
Thanks for taking the time to reply to the post,
ian