创建批处理文件以发布网站 ASP.net

Create a batch file to publish website ASP.net

我创建了一个批处理文件,但没有发布。 这是我的脚本:-

set msbuildpath=C:\Windows\Microsoft.NET\Framework\v4.0.30319
"%msbuildpath%\msbuild" "MyWeb.sln" /t:ReBuild /p:Configuration=Release/p:DeployOnBuild=true /p:PublishProfile=D:\BlaBla\SourceCode\blabla\Properties\PublishProfiles\Pub_Test.pubxml
pause

这里有什么问题?

嗨,看了很多文章,终于找到了解决办法。

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild MyWeb.csproj /p:DeployOnBuild=true /p:PublishProfile=D:\BlaBla\SourceCode\blabla\Properties\PublishProfiles\Pub_Test.pubxml /p:Password=myPassWord /p:AllowUntrustedCertificate=true /p:VisualStudioVersion=11.0

这对我有用。