I am copying .exe file form a separate to my main project's folder on prebuild event but I need to build that project before build my main project so i want to build that project on prebuild event of my main project.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Not that this is the best solution, but it will definately work for what you want to do:
Put the below into your pre-build event
"$(VS100COMNTOOLS)..\IDE\devenv" "csproj location OR sln location" /Rebuild "configuration required if you have more than configuration ex: Debug|x64"
回答2:
This is what worked for me:
"$(DevEnvDir)\devenv" "$(SolutionDir)\MySolution.sln" /Build $(configuration) /project "$(SolutionDir)\MyProjectFolder\MyProject.csproj"
Here $(DevEnvDir)
, $(SolutionDir)
, $(configuration)
are Visual Studio Macros, so this command will be translated into:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\\devenv" "D:\Learning\MySolutionFolder\MySolutionName.sln" /Build Debug /project "D:\Learning\MySolutionFolder\MyProjectFolder\MyProject.csproj"