DLLHell 2018: Upgrading Service Fabric Project from v3.1.283 to v3.2.176

I’m getting an error from each of my xUnit test projects that there is a package downgrade from Microsoft.NETCore.App from 2.0.9 to 2.0.0.

I tried isolating the issue to one project so I unloaded all the test projects in my solution. Then I tried upgrading the version of .NET Core from v2.0 to v2.1. However that produced the following error:

My project dependencies are lit up:

The projects are as follows:

MyApplication.Actor Concrete implementation of my actor. .NET Core 2.1
MyApplication.Actor.Interfaces Actor interface .NET Core 2.1
MyApplication.Actor.Mocks Mock implementation of my actor (for unit testing purposes) .NET Core 2.1
MyApplication.Actor.Model Domain Model implementation for my actor .NET Standard 2.0
MyApplication.Actor.Tests Unit Tests for my actor .NET Core 2.1

It looks like the Service Fabric version is what is killing me. So I removed all the Service Fabric assemblies (and ServiceFabric.Mocks) to try and get the project to be identical to my known good project.

Still can’t update the Test SDK to 15.8.

If I open the two project files and take a look the only difference is the version of the .NET Test SDK. The broken project is still referencing 15.7.0 while the clean new project is referencing 15.8.0.

However there is one small difference. XUnit is being referred to using a “DotNetCliToolReference” instead of a “PackageReference”. When I make the change it finally works.

After I got that working I ran into some compile time errors:

CS0246 The type or namespace name ‘RemotingListener’ could not be found (are you missing a using directive or an assembly reference?)

CS0103 The name ‘RemotingListener’ does not exist in the current context

CS0246 The type or namespace name ‘RemotingClient’ could not be found (are you missing a using directive or an assembly reference?)

CS0103 The name ‘RemotingClient’ does not exist in the current context

Changed to this:

With this small change I was able to get one of my actors building. Now I just need to update all the rest!

However, I still get the same error yet its now incremented the version downgrade from 2.1.3 to 2.1.0! Oh the insanity!

My actor is now showing as .NETCore.App v2.1.3. where as my other actors are showing v2.0.9 as you can see below:

The problem is when the test project references a.NET Core project. When I add a project reference to my control test project I get the same error as my old unit test project.

Maybe I need to update XUnit?

So after a bit more digging I found this thread on GitHub that lead to me actually solving the problem.

Of course, replaysMike probably had his .NET Core projects reporting v2.1.2 while mine have since incremented to v2.1.3. Low and behold, when I applied the change by editing the configuration as follows:

It worked! My dependencies updated with a reference to .NET Core v2.1.3.

So to recap, the steps I had to follow were:

  1. Remove all references to any .NET Core projects (which was causing the downgrade)
  2. Update Nuget references for XUnit framework from v2.3.1 to v2.4.0
  3. Update the project file with the Runtime Framework Version of v2.1.3
  4. Rebuild

And it worked just like magic. Looking back, I probably didn’t need to go through all the trouble of updating my version of Service Fabric / .NET Core / etc but after I did all the work, I’m not reverting!

Sigh…Guess we will never be rid of DLLHell 😊


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s