不废话,直接代码:
D:
cd D:\src\testproj\PrecompiledWeb
svn revert ../ -R
svn update .. rmdir BS /S /Q
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe ..\testproj.sln /p:DeployOnBuild=true;PublishProfile=..\BS\App_Data\PublishProfiles\publish.pubxml /m
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\aspnet_merge.exe" .\BS -o Site -a -r del BS\bin\*.pdb cd ..
node D:\node\node_modules\gulp-cli\bin\gulp.js
cd PrecompiledWeb D:\程序\saBuilder\{sa}Builder.exe %CD%\BS\bin\HZReport.dll;MyZip.dll;SiteBehind.dll;Site.dll set fn=%date:~0,10%
set fn=old-%fn:/=%.zip
del %fn%
cd BS
zip -r -S ..\%fn% .\* copy ..\%fn% \\sdev\temp\
del BS\web.config
xcopy /C /E /Y .\*.* D:\inetpub\wwwroot\old\ 注:
如果有Global.asax且它的代码位于C#文件中,则下面这一行中需要把末尾的 -r 删掉,以生成.complied文件供iis识别。
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\aspnet_merge.exe" .\BS -o Site -a -r
同时pubxml文件中也要把这一行删掉:
<DeleteAppCodeCompiledFiles>True</DeleteAppCodeCompiledFiles> 否则Global.asax会失效!