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

Notification

Icon
Error

How to Prevent Build Events on .NET Standard 2 Library
Envoid
#1 Posted : Tuesday, February 19, 2019 6:49:55 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/7/2012(UTC)
Posts: 3
Location: Shrewsbury, UK

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

I'm having an issue with a .NET Standard 2.0 Library with a pre-build event: even with the option to 'Run pre-build events' set to false (default) it appears to still run the build event.

Resharper runner works as expected.

Testing with a Framework library works as expected. In fact it displays a message to the fact that a 'Pre-build event has been automatically disabled'. I don't see this with the Standard library build.

Any ideas on a solution/work-around?

Thanks,
Chris

VS2017 v15.9.7
NCrunch 3.23.0.10
NUnit 3.11.0

Remco
#2 Posted : Tuesday, February 19, 2019 10:15:16 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for sharing this problem.

There are two different pre-build events that can be declared in a project. One is using the 'PreBuildEvent' project property, the other is by declaring a pre-build target.

By default (and through the configuration setting you've found), NCrunch deactivates the PreBuildEvent property. However, it won't stop any pre-build targets from running. You'll need to suppress these using an inline condition inside your project file.
Envoid
#3 Posted : Wednesday, February 20, 2019 4:07:33 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/7/2012(UTC)
Posts: 3
Location: Shrewsbury, UK

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

Perfect, thanks for that, all working now. I didn't realise I'd need to edit the project file.

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