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

Notification

Icon
Error

NCrunch fails to build project / post build
Queck
#1 Posted : Thursday, October 26, 2017 2:27:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/13/2014(UTC)
Posts: 6
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
Hi,

I am Using VS2017 and NCrunch 3.11.0.9
One of my test projects fails to build in NCrunch
As a error message I get (in short);
....Microsoft.Common.CurrentVersion.targets (5020, 5):
The command "CALL <myfirst.bat> ..... CALL "<my second.bat> exited with code 1.


This is due to a post-build-event of my test project in which I have two calls, each to a specific batch file.
As long as I only have one call in the post-build-event NCrunch has no problem.

Building the project with visual studio every thing works fine, the building as well as the execution of the batch files.
Also if I move the content of the second batch file into the first one and then have one call NCrunch has no problem with building the project an executing the batch.

Is there something I have to do special, if there are more than one batchfile calles in a post-build-event?

Best Regards
Rainer
Remco
#2 Posted : Thursday, October 26, 2017 9:07:36 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for sharing this problem.

By default, NCrunch will disable post build events because usually these involve logic that aren't required for tests to run.

Are these needed for your tests to be run on the project in question? Is it safe to simply disable them using the run post build event configuration setting?
Queck
#3 Posted : Friday, October 27, 2017 6:13:00 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/13/2014(UTC)
Posts: 6
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

I think the „right way“ to do this is found…

I realized that obviously a member of my team has already solved a similar issue.
Applying his solution also solved my problem.
Here is our currently working solution, please let me know if it meets the best practice approach:

In NCrunch-Project settings
  • Add Additional Files
    - Add the required DLLs
    - Add the batch files
  • Run post-build events enabled


Best Regards
Rainer
Remco
#4 Posted : Friday, October 27, 2017 10:05:15 PM(UTC)
Rank: NCrunch Developer

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

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

I was about to ask whether the batch files were both included in the project :)

NCrunch doesn't change the way build events are executed, so my first guess as to why this is not working is that the batch files are not being copied to the workspace. By including them in the project or the 'Additional files to include' setting, NCrunch will be aware of them and will copy them accordingly.
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.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download