Contains notes and lessons in working technology, especially .NET, Azure, DevOps, Agile, and Team Foundation Server.

Tuesday, April 3, 2012

Build Projects and Solutions from Windows Explorer with MSBuild 4.0

Copy the following into a .reg file and run. This will give you the ability to Build, Clean, and Rebuild from the Windows Explorer Context menu.

Windows Registry Editor Version 5.00 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell\Build] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell\Build\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:build\"" 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell\Clean] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell\Clean\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:clean\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell\Rebuild] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.sln\shell\Rebuild\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:rebuild\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Build] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Build\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:build\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Clean] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Clean\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:clean\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Rebuild] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Rebuild\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:rebuild\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell\Build] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell\Build\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:build\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell\Clean] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell\Clean\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:clean\""
[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell\Rebuild] 

[HKEY_CLASSES_ROOT\SystemFileAssociations\.vbproj\shell\Rebuild\command] 
@="cmd.exe /K \"\"%%windir%%\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\" \"%1\" /t:rebuild\""

For more advanced control, try the MSBuild Launch Pad on Codeplex.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.