try-convert
try-convert copied to clipboard
PostBuildEvents and PreBuildEvents are not handled correctly today
in the old project system you could define a PostBuildEvent
like so
<PropertyGroup>
<PostBuildEvent>if exist "$(DevEnvDir)..\..\VC\Auxiliary\Build\vsvars32.bat" (
call "$(DevEnvDir)..\..\VC\Auxiliary\Build\vsvars32.bat"
editbin /largeaddressaware "$(TargetPath)"
)</PostBuildEvent>
</PropertyGroup>
And all the environment variables would be guaranteed to be defined. In the new project format, because of the order of implicit imports, you need to define a target to ensure backwards-compatible behavior. This is the equivalent functionality in the new format:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if exist "$(DevEnvDir)..\..\VC\Auxiliary\Build\vsvars32.bat" (
 call "$(DevEnvDir)..\..\VC\Auxiliary\Build\vsvars32.bat"
 editbin /largeaddressaware "$(TargetPath)"
)" />
</Target>
NOTE: The project property pages already handle this if a user adds something but if they just run try-convert
their PostBuild and PreBuild events may not work correctly
Took me quit some time to figure this out. Thanks alot for the bug entry...