Question

I am attempting to use the Microsoft.Practices.Prism library in a universal windows phone/windows 8.1 app in Visual studio 2013. It was working great for the first day. Today when I logged in my build would fail because it claimed it did not have a reference to Microsoft.Practices, however intellisense would pick up both Microsoft.Practices and Microsoft.Practices.Prism. So I uninstalled Prism using nuget package manager, then reinstalled it. Now I am getting this error.

I have seen posts claiming that updating nuget solved this issue but I have the most recent version (I uninstalled nuget and reinstalled)

This is the error I get

Edit: Just for clarification prism does support 4.5 so this error does not really make much sense

Was it helpful?

Solution

NuGet will not let you install a NuGet package into a project that is targeting a .NET framework which is not included in the NuGet package.

Your project is targeting Windows 8/Windows Store (.NETCore). The Prism.Composition NuGet package has an assembly for the full .NET Framework. NuGet considers these to not be compatible which is why you are getting the error. The Prism NuGet package may be using parts of the full .NET Framework which are not available to a Windows Store application which is why NuGet is failing.

The version number is not the problem. If your project was targeting the full .NET Framework 4.5.1 then you could install Prism.Composition which has an assembly for the full .NET Framework 4.5.

In order to install a NuGet package into a Windows Store project it would need to explicitly target Windows 8 or include a Portable Class Library (PCL) which is compatible.

There are a couple of Prism NuGet packages that contain PCLs that you might be able use instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top