Build/Test Issues

How to Prevent Build Events on .NET Standard 2 Library

Started by Envoid on 1,807 views

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

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.

Edited

Hi Remco,

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

Chris

Post a reply

Log in to reply.