I just downloaded PoshConsole's source code and was trying to build the solution. I initially had two problem -
the System.Interactivity.dll could not be resolved. I installed Blend 4 SDK and that issue was fixed.
Unknown build error - Cannot resolve dependency to System.Windows
Right now, whenever I try to build the project, I get the following error in two projects in the solution and I haven't been able to find a solution after some googling around.
Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
I have received this error message for another (non-GAC, custom) assembly.
In my case, the situation was as follows:
Y referenced X, Z referenced Y.
The error message was pointing to the line in the data template in Z where B was referenced, and pointed out that X could not be loaded.
The solution was to have Z also reference X. Apparently, the compiler cannot resolve that transitive reference for loading the required assemblies on its own.
That error generally means that you've added a reference to a Silverlight assembly within a WPF project - the two can't coexist.
See: Errors when referencing Silverlight class library from WPF application
In your [projectName].csproj file, you can identify the non-resolvable dependency and remove it before add it again latter.
Hope it will help others
I'm going to toss in and answer on this old question, in-case someone runs into the same issue.
I was recently working on a legacy program and had this error. The solution was not readily apparent.
Issue
One of the NuGet packages referenced was created for a bunch of internal libraries and stored on the internal NuGet repository.
The applications compiled fine on VS2013, due to all the NuGet references having in the Project files, directly to the libraries.
When these references were changed to (Does not support HintPath), many of these NuGet packages were not created according to nuspec. There was no lib folder.
The packages were remade to follow the spec, however several of the packages had old Silverlight libraries included in them. These libraries were causing the error.
Solution
Following nuspec, the lib folder had sub-folders created: net45 and sl4. .NET4.5 and Silverlight4.0 respectively.
When the packages were replaced with the new ones, the builds worked fine. Regardless of Project file version.
TL;DR
Old nupkg structure:
Package.1.0.0.nupkg
- Library.Net40.dll
- Library.Sl4.dll
New nupkg structure:
Package.1.0.1.nupkg
- lib
- net45
- Library.dll
- sl4.0
- Library.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With