从发布命令行和Web.config文件转换ASP.NET MVC 2应用程序 [英] Publish ASP.NET MVC 2 application from command line and Web.config transformations
问题描述
美好的一天!
我已经在这里找到这个解决方案:<一href=\"http://stackoverflow.com/questions/4029541/vs2010-web-publish-command-line-version-of-file-system-deploy\">VS2010网站发布文件系统的命令行版本部署
I've found this solution here: VS2010 Web Publish command line version of File System deploy
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
.\MyProject.csproj /p:Configuration=Release;DeployOnBuild=True;PackageAsSingleFile=False;outdir=c:\_OuputDir\
但似乎Web.config文件转换没有被执行。
But it seems that Web.config transformations are not performed.
可能有更好的\\清洁复制发布Web对话框VS2010方式?
May be there is better\cleaner way to duplicate "Publish Web" VS2010 dialog?
更新:这是标答案是最短的命令行执行发布,我已经发现迄今。 Web.config文件转换应用,但连接字符串的处理方式不同,这里是一个描述\\解决方法
Update: The answer which is marked is the shortest command-line to perform publish, that I've found so far. Web.config transformations ARE applied, but connection strings are treated differently, here is a description\workaround
推荐答案
这可能工作(我发现<一个href=\"http://pattersonc.com/blog/2010/07/15/visual-studio-2010-publish-command-from-msbuild-command-line/\"相对=nofollow>这里):
This might work (which I found here):
msbuild solution.sln /p:Configuration=Release;DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=..\publish
然而,它给了我下面的错误,当我试图运行它(我还在努力解决):
However, it gave me the following error when I tried to run it (which I'm still working to fix):
C:\\ [路径] \\ [配置] \\ csautoparameterize \\原有\\的web.config(40):错误ASPCONFIG:这是使用注册为allowDefinition =应用程序级别之外'MachineToApplication'的节是错误的。这个错误可以通过未被配置为在IIS中应用程序的虚拟目录引起的。
C:\[path]\[config]\csautoparameterize\original\web.config(40): error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
这篇关于从发布命令行和Web.config文件转换ASP.NET MVC 2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!