This is very easy to do. Open your build definition and go to the "Process" page. Then under the "3. Advanced" group you have a property called "MSBuild Arguments". Place the parameter there with the following syntax "/p:VisualStudioVersion=12.0". Of course without the quotes. If you have more parameters, separate them with a space and not a comma.
echo off
path %SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\
msbuild.exe .\src\ElectricManagement.sln /t:Rebuild /p:Configuration=Release /p:VisualStudioVersion=12.0
::/l:FileLogger,Microsoft.Build.Engine;logfile=Build1.log
msbuild .\src\ElectricManagement.Web\ElectricManagement.Web.csproj /t:ResolveReferences;Compile /t:_WPPCopyWebApplication /p:Configuration=Release /p:VisualStudioVersion=12.0 /p:WebProjectOutputDir=..\..\Release
::/l:FileLogger,Microsoft.Build.Engine;logfile=Build2.log
echo 編譯當前項目完畢
pause
這個時候發現項目文件打不開,無法重新加載項目,這個時候可以嘗試手動編譯一下項目。
參考
http://www.cnblogs.com/shiningrise/p/3973962.html