Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

The primary reference could not be resolved (target mismatch)
Momyshka
#1 Posted : Friday, August 22, 2014 6:43:58 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/16/2014(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Hello!
Newtonsoft.Json is installed via Nuget packages.
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />

NCrunch shows errors like :''The type or namespace name could not be found (are you missing a using directive or an assembly reference?)
" for project, where Newtonsoft.Json is installed

Also, I see next warnings during build via Ncrunch (and it seemed this is the reason of the NCrunch failure):

"WARNING - C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets: The primary reference "D:\NCrunchWorkFolder\9336\210\WebSite\bin\WebSite.dll" 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".

WARNING - C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets: The primary reference "D:\NCrunchWorkFolder\9336\227\Authentication\bin\Debug\Authentication.dll" 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".

WARNING - C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets: The primary reference "D:\NCrunchWorkFolder\9336\207\Logic\bin\Debug\Logic.dll" 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".
"
and UnitTest project fails to be build via Ncrunch (via VS or Teamcity everything is good)



Any help will be approciate. (i see topic with smth like this, but it was related to old build, 1.0.6.xxxx)
Remco
#2 Posted : Friday, August 22, 2014 11:27:11 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

Does placing NCrunch in compatibility mode resolve this problem?
1 user thanked Remco for this useful post.
Momyshka on 8/25/2014(UTC)
Momyshka
#3 Posted : Monday, August 25, 2014 10:31:02 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/16/2014(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Yes, it helps. Thanks a lot.
1 user thanked Momyshka for this useful post.
Remco on 8/25/2014(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download