Created
April 16, 2015 09:47
-
-
Save sayedihashimi/6c352cb78591f7abe04f to your computer and use it in GitHub Desktop.
Revisions
-
sayedihashimi created this gist
Apr 16, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- You can use this file to disable pre and post events globally across both MSBuild and Visual Studio. To use this file, you have two options. 1. Save this file as C:\Program Files (x86)\MSBuild\v14.0\Custom.After.Microsoft.Common.targets Or whatever the value of the MSBuild property $(CustomAfterMicrosoftCommonTargets). 2. Save this file to a random location, lets say C:\temp\msbuild\nopreorpostevents.targets, then set the CustomAfterMicrosoftCommonTargets env var to point to that file. Then start Visual Studio. You can set this from a PowerShell prompt (cmd prompt as well of course) and then start Visual Studio from that prompt to apply the environment variable. ```powershell $env:CustomAfterMicrosoftCommonTargets='C:\temp\msbuild\nopreorpostevents.targets' "${env:ProgramFiles(x86)}\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" ``` You can also call MSBuild from the prompt and it will honor that property as well. If you're calling MSBuild from PowerShell see psbuild https://github.com/ligershark/psbuild. --> <!-- Add the target that will override the property to the top of the build targets --> <PropertyGroup> <BuildDependsOn> DisablePreAndPostEvents; $(BuildDependsOn); </BuildDependsOn> </PropertyGroup> <Target Name="DisablePreAndPostEvents"> <Message Text="Removing pre and post events (via $(MSBuildThisFileFullPath))" /> <!-- Since this is inside a target it will overwrite any previous value even global ones --> <PropertyGroup> <PreBuildEvent></PreBuildEvent> <PostBuildEvent></PostBuildEvent> </PropertyGroup> </Target> </Project>