“Build” item in Windows Explorer's context men

2020-06-16 01:22发布

I wonder why this is not integrated by default. I'd like to have an item in Windows Explorer's file context menu of a VS solution file to build it.

Is there a tool for this? Or do I have to create this myself?

5条回答
女痞
2楼-- · 2020-06-16 02:04

Here is a project to do it for VS 2003 & 2005. It could easily be altered for 20080 and 2010 too i imagine.

http://www.codeproject.com/KB/winsdk/VS_BuildHere.aspx

查看更多
相关推荐>>
3楼-- · 2020-06-16 02:13
来,给爷笑一个
4楼-- · 2020-06-16 02:15

You might be able to cook up something using MSBuild.exe along the lines of

<path_to_msbuild_executable>\MSBuild.exe /p:Configuration="<config>" %1

However, you would have to specify a configuration and then it will be hard to see all the output from the build. I'm not sure this would make all that much sense.

查看更多
疯言疯语
5楼-- · 2020-06-16 02:16

It's going to be fairly high maintenance, but not impossible. Open Regedit.exe and locate the HKCR\VisualStudio.csproj.9.0 key. Add the Build verb, make it look similar to this:

[HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0\shell\Build]

[HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0\shell\Build\Command] @="cmd.exe /k c:\temp\build.bat %1"

The cmd.exe /k command opens a console window so that you can read any error message from the build. The c:\temp\build.bat file ought to look similar to this:

call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
msbuild %1

You probably also want to add the Build key to HKCR\VisualStudio.Launcher.sln so you can build solutions as well. That however is a bit of a version maintenance headache.

查看更多
登录 后发表回答