Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Nancy.Serialization.JsonNet 0.22.2 for .NET 4.0 has a dependency on a .NET 4.5 JSON.NET dll #9

Open
StefanBilliet opened this issue Apr 16, 2014 · 0 comments

Comments

@StefanBilliet
Copy link

Hi

I have a .NET 4.0 web api project with NancyFX and your serialization plugin. This project stops building as soon as I reference the JsonNetSerializer class directly with the error: Composition\Bootstrapper.cs(5,13): error CS0234: The type or namespace name 'Serialization' does not exist in the namespace 'Nancy' (are you missing an assembly reference?)

Further investigation in our build.log file yields this warning:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3275: The primary reference "Nancy.Serialization.JsonNet" could not be resolved because it has an indirect dependency on the assembly "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

I checked the .dll in your NuGet package with DotPeek and even though it clearly states it's a .NET 4.0 dll, if I download your master.zip, swap out the JSON.NET reference to one with version 6.0.2 (also .NET 4.0), repack your package and use that one, everything works again.

If I replicate the project as a .NET 4.5 project, everything also works.

Thanks in advance for the help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant