This project is read-only.
7
Vote

Unity 3.5 and .NET 4.5.2

description

I get build warning:

The primary reference "Microsoft.Practices.Unity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.5.2". To resolve this problem, either remove the reference "Microsoft.Practices.Unity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

comments

mkchandler wrote May 14, 2014 at 4:43 PM

I'm having this same issue in a MVC web app.

mkchandler wrote May 14, 2014 at 4:50 PM

By the way, I have a different app that uses Unity 3.5 and targets .NET 4.5.1 and it works fine. This just breaks when targeting 4.5.2.

mkchandler wrote May 14, 2014 at 4:58 PM

Workaround for now is to retarget to .NET 4.5.1. My project passed builds as soon as I switched target from .NET 4.5.2 to 4.5.1.

Please let me know if you need any more information for this bug. I have the default 4.5.2 production release stuff installed on my machine.

randylevy wrote May 16, 2014 at 4:55 AM

@mkchandler thanks for the details.

It appears there is an issue with the System.Runtime assembly versioning in the .NET 4.5.2 release. There is a bug logged on connect.

frma wrote Jun 4, 2014 at 7:49 AM

A workaround is described here:
http://support.microsoft.com/kb/2971005

samyom wrote Nov 13, 2014 at 1:24 AM

Is this thing resolved? I am having these warnings with automated build via TFS.
All is fine on my local box.

I did install the above mentioned 4.5.2 dev-pack but still it's not working.

Any ideas?

bigjoed wrote Jan 13, 2016 at 7:04 PM

This doesn't seem to work with 4.5.2 framework and unity 4.0.1 as well. Any clue to how to fix this?