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

Notification

Icon
Error

`project.assets.json' not found. Run a NuGet package restore to generate this file.
sjkirk
#1 Posted : Tuesday, October 2, 2018 7:42:40 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/23/2015(UTC)
Posts: 9
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
I'm trying to use NCrunch with https://github.com/cwensley/Portable.Xaml and I'm getting the following error on all of the projects in the solution under ncrunch:

```
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 'D:\projects\AvaloniaUI\Portable.Xaml\artifacts\obj\nCrunchTemp_e60e51a2-bb4d-4077-aefb-8187cee5205f\project.assets.json' not found. Run a NuGet package restore to generate this file.
at nCrunch.Compiler.ComponentAnalysisContext.()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
```

Any idea why this isn't working?
Remco
#2 Posted : Tuesday, October 2, 2018 7:53:07 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

The problem here is being caused by the Directory.build.props file in the solution's root directory. This file overrides the BaseIntermediateOutputPath to a file that is derived from the project's file name. This interferes with NCrunch's ability to load the project, because NCrunch needs to produce a temporary project file (under a temporary name) to load data from the project. See here for more details.

The only way to resolve this is to avoid setting the BaseIntermediateOutputPath in your projects to the MSBuildProjectName property. Unfortunately the structure of the platform is such that there is no way we can make NCrunch work on a CPS based project that sets its BaseIntermediateOutputPath to the name of the project.
1 user thanked Remco for this useful post.
talbrecht on 6/2/2022(UTC)
sjkirk
#3 Posted : Tuesday, October 2, 2018 8:17:55 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/23/2015(UTC)
Posts: 9
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Thanks for the super-quick reply Remco!

I'll open an issue on the repository to see if there's a way to avoid setting BaseIntermediateOutputPath.

Thanks again!
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.028 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download