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

Notification

Icon
Error

Dependencies for Targets aren't copied
MatthewSteeples
#1 Posted : Friday, April 17, 2015 2:15:12 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 142
Location: United Kingdom

Thanks: 7 times
Was thanked: 19 time(s) in 17 post(s)
I'm still researching the answer for this, so may end up answering my own question, but I have the following problem:

Some NuGet packages (in my case Microsoft.Diagnostics.Tracing.EventRegister) contain .exe files that are executed as part of the build. The .targets file gets copied across to the grid node server to be included in the build but the .exe file (that it needs to run) doesn't.

I'm either looking for a way to disable this .targets file from being run, ignoring the error so that the project continues to build, or copying the .exe (and other files needed from the packages folder) so that the command runs successfully.
MatthewSteeples
#2 Posted : Friday, April 17, 2015 2:23:43 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 142
Location: United Kingdom

Thanks: 7 times
Was thanked: 19 time(s) in 17 post(s)
For now I have tweaked the csproj file to exclude the .targets reference when it's being built under NCrunch:

Changed
<Import Project="..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.0.26\build\Microsoft.Diagnostics.Tracing.EventRegister.targets" Condition="Exists('..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.0.26\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" />
to
<Import Project="..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.0.26\build\Microsoft.Diagnostics.Tracing.EventRegister.targets" Condition="Exists('..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.0.26\build\Microsoft.Diagnostics.Tracing.EventRegister.targets') AND '$(NCrunch)' != '1'" />
Remco
#3 Posted : Friday, April 17, 2015 10:37:31 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for sharing this issue.

NCrunch is able to detect most dependencies of a build automatically, but sometimes .EXEs and other files are referenced obscurely from the build targets and NCrunch isn't able to pick them up. If you want your build to run the same in the NCrunch workspace as it does in the foreground solution, the easiest way to handle this is to just add the files to the 'Additional files to include' configuration setting. You can read more here about this problem - http://www.ncrunch.net/documentation/considerations-and-constraints_implicit-file-dependencies.
MatthewSteeples
#4 Posted : Friday, April 17, 2015 10:41:08 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 142
Location: United Kingdom

Thanks: 7 times
Was thanked: 19 time(s) in 17 post(s)
Remco;7224 wrote:
... the easiest way to handle this is to just add the files to the 'Additional files to include' configuration setting.


Thanks for that. I think that's what we'll end up doing for some items. In this instance the executable is only required to run for the build process and is not necessary for testing so our current solution works.
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.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download