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

Notification

Icon
Error

Load Failure _SplitProjectReferencesByFileExistence
johnjacobs
#1 Posted : Wednesday, June 26, 2013 10:05:35 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/26/2013(UTC)
Posts: 1
Location: Estonia

Out of the box (after fixing lot's of other errors with my project set up I didn't even know about before NCrunch =D), I get this cryptic error loading a project.

Code:
Errors occurred while trying to load the project file: 
The target "_SplitProjectReferencesByFileExistence" does not exist in the project.


This project in particular actually has no code, so it shouldn't affect any test runs. It's used to hold media content files used in a web app.

Any ideas what might cause this and how I could fix it to make all projects "Build Successful"?
Remco
#2 Posted : Wednesday, June 26, 2013 12:21:31 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting!

NCrunch makes use of this particular build target while loading projects and interrogating them for information. If the target isn't present, my guess would be that this project is custom designed and isn't making use of any standard .NET build targets (please do correct me if this guess is wrong - as I'd otherwise like to know which frameworks it may be using).

If the project doesn't contain any code, is it possible that no other projects are depending on it? If it contains no testable code, you're probably best to just switch it off with the Ignore this component completely configuration setting.
alastairs
#3 Posted : Friday, March 10, 2017 12:22:16 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/13/2011(UTC)
Posts: 54
Location: Cambridge, UK

Thanks: 22 times
Was thanked: 4 time(s) in 4 post(s)
Seeing the age of this post, I'm surprised, but I'm hitting this error in the latest build of NCrunch v3.5, with a .NET Core library targeting .NET Standard 1.6 and .NET 4.6. In my case, this project contains code that is under test so I can't just ignore it.
sjkirk
#4 Posted : Friday, March 10, 2017 5:28:05 PM(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)
Yeah I'm hitting this with a .NET core libraries too. You can see the problem at https://github.com/AvaloniaUI/Avalonia in many of the unit tests.
Remco
#5 Posted : Friday, March 10, 2017 10:48:31 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

The _SplitProjectReferencesByFileExistence problem appears when the build system doesn't contain the expected targets, which can happen if NCrunch doesn't properly recognise the target platform of the project being built. These problems have always been solved with functional fixes, so I guess the error itself was never improved.

The problem you're likely facing is that NCrunch isn't able to work with projects set to target multiple frameworks at the same time. This is a new .NET Core feature and it's rather complex, so it may take a few weeks to work out. For the time being, I recommend looking into alternative structures for your projects, such as 'shared' projects or two projects files sharing the same directory.
alastairs
#6 Posted : Sunday, March 12, 2017 8:21:44 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/13/2011(UTC)
Posts: 54
Location: Cambridge, UK

Thanks: 22 times
Was thanked: 4 time(s) in 4 post(s)
Thanks for the quick response, Remco :)

Remco;9933 wrote:
The problem you're likely facing is that NCrunch isn't able to work with projects set to target multiple frameworks at the same time.

These projects were indeed multitargeting different frameworks, so I've just gone through the solution and removed all multitargeting from all the projects. However, the error seemed persistent, even after deleting all the NCrunch files in my working copy (The _NCrunch_Solution directory, all the .ncrunchsolution and .ncrunchproject files, and all the .ncrunch*.user files too).

I tried NCrunch out on a brand new solution, and obviously it worked just fine, but when I copy-pasted the contents of one of the project files exhibiting this error into one of my brand new project files, suddenly I started seeing the error in that project too. Paring the project file back to the barest minimum code didn't resolve the problem, and I couldn't see anything in the following that would cause this error:

Code:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>netcoreapp1.1</TargetFrameworks>
  </PropertyGroup>
</Project>


It turned out the problem was that I needed to change TargetFrameworks to TargetFramework.

It's interesting that this only causes a build error in NCrunch, and not in VS or the dotnet CLI tool. Might it be possible to catch this error and provide some guidance to the user on how to resolve it, or handle the situation more gracefully, like VS and dotnet CLI do?
Remco
#7 Posted : Sunday, March 12, 2017 8:59:47 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
alastairs;9943 wrote:

It turned out the problem was that I needed to change TargetFrameworks to TargetFramework.

It's interesting that this only causes a build error in NCrunch, and not in VS or the dotnet CLI tool. Might it be possible to catch this error and provide some guidance to the user on how to resolve it, or handle the situation more gracefully, like VS and dotnet CLI do?


Good catch. I'll have to think carefully about this one. This is actually a surprisingly difficult thing to handle reliably under NCrunch because of the way MSBuild evaluation is handled. At the moment NCrunch actually needs to parse this out of the file before it can invoke any MSBuild logic, and the parsing needs to fall back onto the 'old' integration style for projects that don't declare the element. We're at the stage now where there are so many different project types now supported that placing an error for a missing element is almost certain to cause some other unknown project type to start failing.
Remco
#8 Posted : Wednesday, March 15, 2017 4:39:13 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
A fix for this is now out with v3.6.
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.054 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download