You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you conditionally exclude a NuGet package based on whether we're in the wpf MarkupCompile phase (the _wpftmp project), any .targets or .props files in that NuGet packages build folder will still be executed during the _wpftmp build if IncludePackageReferencesDuringMarkupCompilation is true.
This behavior was surprising to me. Now that I've read through the code in Microsoft.WinFX.targets, I can understand the why things happen the way they do, but thought it was worth reporting anyways.
For some background, we use a code analysis NuGet package that I wanted to turn off during the MarkupCompile/inner build of the _wpftmp project. The analyzers are slow, we have more warnings than I'm proud of, and with them enabled during the _wpftmp build we get twice the number of warnings. I thought I would be able to put a condition on the PackageReference that excludes the package if we're in the _wpftmp build. However, when I did that, projects that had IncludePackageReferencesDuringMarkupCompilation set to true failed to build because the package wasn't included but the package's .targets file from the build folder was still executing.
I've created a small project that reproduces the issue. You can get it here.
SDK Version 5.0.104
The text was updated successfully, but these errors were encountered:
If you conditionally exclude a NuGet package based on whether we're in the wpf MarkupCompile phase (the
_wpftmp
project), any.targets
or.props
files in that NuGet packagesbuild
folder will still be executed during the_wpftmp
build ifIncludePackageReferencesDuringMarkupCompilation
istrue
.This behavior was surprising to me. Now that I've read through the code in Microsoft.WinFX.targets, I can understand the why things happen the way they do, but thought it was worth reporting anyways.
For some background, we use a code analysis NuGet package that I wanted to turn off during the MarkupCompile/inner build of the
_wpftmp
project. The analyzers are slow, we have more warnings than I'm proud of, and with them enabled during the_wpftmp
build we get twice the number of warnings. I thought I would be able to put a condition on thePackageReference
that excludes the package if we're in the_wpftmp
build. However, when I did that, projects that hadIncludePackageReferencesDuringMarkupCompilation
set to true failed to build because the package wasn't included but the package's.targets
file from thebuild
folder was still executing.I've created a small project that reproduces the issue. You can get it here.
SDK Version 5.0.104
The text was updated successfully, but these errors were encountered: