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

Notification

Icon
Error

Referencing packages from targets file doesn't work
forki23
#1 Posted : Wednesday, December 10, 2014 4:38:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/10/2014(UTC)
Posts: 3
Location: Germany

In https://github.com/fsprojects/Paket/tree/targets we created .targets files for the NuGet packages.

In order to reproduce you can

0) Clone or download the targets branch from the link above
1) Run build.cmd to restore all files
2) Open VS and build in VS (works)
3) Activate nCrunch - build doesn't work since nCrunch can't understand the targets files

the _ncrunchereferences folder seems to be OK and "Copy Referenced Assemblies To Workspace" doesn't help.

Cheers,
Steffen
Remco
#2 Posted : Wednesday, December 10, 2014 7:51:25 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 Steffen,

Thanks for sharing this one. I'll take a look and will see what I can do :)

Did using the 'Additional files to include' setting allow you to include the files manually and work around the problem?


Cheers,

Remco
forki23
#3 Posted : Thursday, December 11, 2014 8:06:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/10/2014(UTC)
Posts: 3
Location: Germany

Hi Remco,

all files are in the _ncrunchereferences. It just can't reference these, because the references are in a .targets file

Cheers,
Steffen
Remco
#4 Posted : Thursday, December 11, 2014 9:11:39 AM(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)
Ahhh - I understand now. This could be a big problem, and I don't think NCrunch is able to solve it in its current state.

NCrunch works by overriding references inside the project file at build time. This includes rewriting the project file by removing existing references and re-adding them with stricter declarations pointing at the locations inside _ncrunchreferences.

Where there is additional logic around these references (for example, they are situated inside target files external to the project file, or they have conditional logic attached to them), NCrunch cannot manipulate these references because they existing outside its normal working scope. There are unfortunate limits to NCrunch's intelligence when working with customised build setups, and references declared outside the project file unfortunately go beyond these limits. I recommend redesigning your build so that the references can sit within the project file.
forki23
#5 Posted : Thursday, December 11, 2014 9:14:51 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/10/2014(UTC)
Posts: 3
Location: Germany

I think that's totally OK to overwrite references - but it should be done recursivly in targets files
Remco
#6 Posted : Thursday, December 11, 2014 9:23:21 AM(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)
forki23;6680 wrote:
I think that's totally OK to overwrite references - but it should be done recursivly in targets files


I agree, but unfortunately NCrunch is limited by what the underlying toolset (MSBuild) is able to provide. This probably seems crazy, but because the references are by definition imported, MSBuild will not allow them to be manipulated. Sorry, but this problem cannot be solved in NCrunch.
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.042 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download