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

Notification

Icon
Error

Load failure project.assets.json doesn't have a target for 'netstandard2.0' on a .NET 4.8 project
Tim Long
#1 Posted : Monday, April 28, 2025 8:35:11 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 26
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
I've started getting an issue where none of my projects will load (even though they are all fine in Visual Studio 2022) because:

Quote:

System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> nCrunch.Common.UserException: Errors occurred while trying to load the project file:
Assets file 'J:\OSL-Projects\beacon-final-test\OSL.BeaconFinalTest.Diagnostics.CBusFlagReader\obj\project.assets.json' doesn't have a target for 'netstandard2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project.
There is a circular dependency in the target dependency graph involving target "ResolveProjectReferences".
at nCrunch.Compiler.ComponentAnalysisContext.()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
--- End of inner exception stack trace ---


I note the line that says there is a "circular dependency" but I really don't think there is, or if there is then I don't understand how. I'm not really sure how to even start troubleshooting this and would appreciate any guidance.
Remco
#2 Posted : Monday, April 28, 2025 9:27:23 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,277

Thanks: 983 times
Was thanked: 1323 time(s) in 1227 post(s)
Hi, thanks for sharing this issue.

Are you running a preview version of VS? There is a fix published here for a similar reported issue: https://forum.ncrunch.net/yaf_postst3574_Can-no-longer-build-after-VS2022-17-14-0-Preview-3-0-update.aspx
Tim Long
#3 Posted : Monday, April 28, 2025 10:17:48 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 26
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Yes, I'm running the preview and in fact it updated this morning after I've been on leave for a week. I have installed the build attached to the other post you referenced, and it does seem to have fixed the issue. Once of my projects is now failing to build because of:

NCrunch: This project was built on server '(local)'
[obfuscated].csproj (255, 78): The target "GetVersion" does not exist in the project.

I'm not sure if this is related to the same issue but it might be related to the fact that I'm using GitVersion. I right-clicked then "Reload and Rebuild this project" and it build the second time. In fact, thinking about it, the project is not referenced in the test project so it may have just needed a forced build.
Remco
#4 Posted : Monday, April 28, 2025 11:35:16 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,277

Thanks: 983 times
Was thanked: 1323 time(s) in 1227 post(s)
Tim Long;18087 wrote:

I'm not sure if this is related to the same issue but it might be related to the fact that I'm using GitVersion. I right-clicked then "Reload and Rebuild this project" and it build the second time. In fact, thinking about it, the project is not referenced in the test project so it may have just needed a forced build.


Sometimes when VS loads projects they can be in an inconsistent state when NCrunch gets to them. If the problem is gone after a VS rebuild and reload of the NCrunch engine, then most likely it's nothing to worry about.

If it persists under NCrunch and it doesn't show up when building the project via MSBuild (or dotnet build) on the command line, then it's something that warrants attention (from the NCrunch side at least).
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.034 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download