VS2010 Web发布命令行版本的文件系统部署 [英] VS2010 Web Publish command line version of File System deploy
问题描述
Folks,
简而言之,我要复制此对话框:
这是一个Visual Studio 2010 ASP.Net MVC项目。如果我执行这个命令,我得到所有的文件,包括在C:\ToDeploy目录中转换的web.configs。
我要复制这在命令行上,所以我可以使用它的QA环境构建。
我已经看到了各种文章,如何在命令行上远程部署,但我只是想为文件系统部署。
我知道我可以使用nAnt任务或rake脚本复制这个功能,但我想使用这个机制所以我不会重复自己。
我已经调查了这些,我找到了这些链接,但没有一个解决它干净:
$ b
您需要的命令行是:
msbuild path / to / your / webdirectory / YourWeb.csproj / p:Configuration = Debug; DeployOnBuild = True; PackageAsSingleFile = False
您可以通过添加 outdir = c:\wherever\\的属性来更改项目输出的位置
这将在以下位置创建输出:
pre> path / to / your / webdirectory / obj / Debug / Package / PackageTmp /
b $ b
然后,您可以使用任何方法从上述目录中复制这些文件。
我有一个工作作为一个ruby rake任务,使用 Albacore 。我试图让所有这一切,所以我可以把它作为一个贡献的项目。但是如果有人想要的代码之前,让我知道。
我发现的另一个皱痕,是把Tokenized参数到Web.config。如果您不需要该功能,请务必添加:
/ p:AutoParameterizationWebConfigConnectionStrings = false
Folks,
In a nutshell, I want to replicate this dialog:
It's a Visual Studio 2010 ASP.Net MVC project. If I execute this command, I get all the files I want, including the transformed web.configs in the "C:\ToDeploy" directory.
I want to replicate this on the command line so I can use it for a QA environment build.
I've seen various articles on how to do this on the command line for Remote Deploys, but I just want to do it for File System deploys.
I know I could replicate this functionality using nAnt tasks or rake scripts, but I want to do it using this mechanism so I'm not repeating myself.
I've investigated this some more, and I've found these links, but none of them solve it cleanly:
- VS 2008 version, but no Web.Config transforms
- Creates package, but doesn't deploy it..do I need to use MSDeploy on this package?
- Deploys package after creating it above...does the UI really do this 2 step tango?
Thanks in advance!
Ok, finally figured this out.
The command line you need is:
msbuild path/to/your/webdirectory/YourWeb.csproj /p:Configuration=Debug;DeployOnBuild=True;PackageAsSingleFile=False
You can change where the project outputs to by adding a property of outdir=c:\wherever\
in the /p: section.
This will create the output at:
path/to/your/webdirectory/obj/Debug/Package/PackageTmp/
You can then copy those files from the above directory using whatever method you'd like.
I've got this all working as a ruby rake task using Albacore. I am trying to get it all done so I can actually put it as a contribution to the project. But if anyone wants the code before that, let me know.
Another wrinkle I found was that it was putting in Tokenized Parameters into the Web.config. If you don't need that feature, make sure you add:
/p:AutoParameterizationWebConfigConnectionStrings=false
这篇关于VS2010 Web发布命令行版本的文件系统部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!