MSBuild的DeployOnBuild

MSBuild的DeployOnBuild

本文介绍了MSBuild的DeployOnBuild =真不发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我通过使用哈德森命令行构建的Visual Studio 2010 MVC2 Web应用程序。我想使哈德森发布Web输出,所以我增加了DeployOnBuild =真实CreatePackageOnPublish = TRUE标签到我的命令行。

I have a Visual Studio 2010 MVC2 web application that I'm building via the command line using Hudson. I'd like to make Hudson publish a web output, so I added the DeployOnBuild=true and CreatePackageOnPublish=True tags to my command line.

我的命令是:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
   /target:Clean,Build
   /property:Configuration=Debug;DeployOnBuild=True;CreatePackageOnPublish=True;
   [my project name.csproj]

我的开发机器(Windows 7)中运行此命令成功发布一个网络输出到 \\ OBJ \\调试\\包\\ PackageTmp \\ 。但运行它的哈德逊服务器(WS 2008)上成功编译,但它并没有公布。相同的命令,同一个版本的MSBuild的,相同的源$ C ​​$ C。

Running this command on my development machine (Windows 7) successfully publishes a web output to \obj\Debug\Package\PackageTmp\. But running it on the Hudson server (WS 2008) compiles successfully, but it doesn't publish. Same command, same version of MSBuild, same source code.

我试过 /吨:发布目标,这给了我一个跳跃Unpublishable项目的反应,因为我已经看到了其他几个人的帖子。

I've tried the /t:Publish target, which gives me a Skipping Unpublishable Project response, as I've seen on several other people's posts.

我试着加入 DeployOnBuild = TRUE CreatePackageOnPublish = TRUE 标签到我的项目文件为好,并没有任何改变。

I've tried adding the DeployOnBuild=True and CreatePackageOnPublish=True tags to my project file as well, and no change.

这是这是为什么不公布有什么想法?我使用这些标签不正确?我敢肯定,这里有东西,我只是没有看到。

Any thoughts on why this isn't publishing? Am I using these tags incorrectly? I'm sure there's something here that I'm just not seeing.

推荐答案

假设你做的不可以您的哈德森服务器上安装了Visual Studio 2010,那么这可能是因为你缺少出版目标文件。很多头对撞桌子后,我终于解决了这一点。

Assuming you do not have Visual Studio 2010 installed on your hudson server, then it may be that you are missing the publishing "targets" file. After a lot of head-to-desk banging, I finally solved this.

相当长一段时间我都知道,我需要复制的目录

For quite a while I have known that I needed to copy the directory

C:\\ Program Files文件(x86)的\\的MSBuild \\微软\\ VisualStudio的\\ 10.0 \\ web应用

这是我的本地机器与VS2010到我的服务器,以获得该项目的建立。但要获得该项目还的发布我需要也拷贝过来的目录

from my local machine with VS2010 to my server in order to get the project to build. But to get the project to also publish I needed to also copy over the directory

C:\\ Program Files文件(x86)的\\的MSBuild \\微软\\ VisualStudio的\\ 10.0 \\ WEB

请注意:在我的情况下,我居然犯这些文件夹到我的源控制和改变< MSBuildExtensionsPath32> 在我的csproj文件的价值指向这些签出文件夹(所以当prepping服务器少了一个步骤)。这是没有必要得到它的工作,但你可能要考虑这一点,你解决您的问题后。

Note: In my case I am actually committing those folders to my source control and changing the <MSBuildExtensionsPath32> value in my csproj file to point to these checked out folders (so there is one less step when prepping a server). This isn't necessary to get it to work, but you may want to consider this after you solve your issue.

更新:所以,我做以上后,构建抱怨说,它找不到Microsoft.Web.Deployment.dll。为了解决这个问题,我需要在服务器上安装 即使我只发布到文件系统。我想我可以看到在这个逻辑。

UPDATE: So after I did the above, the build complained that it could not find "Microsoft.Web.Deployment.dll". To solve this I needed to install Microsoft Web Deploy v2.0 on the server even though I am only publishing to the file system. I guess I can see the logic in this.

更新:我已经发现,在安装Visual Studio 2010的外壳(集成)通过IIS Web平台安装程序将安装所需的构建目标。这似乎是没有在服务器上安装整个Visual Studio应用程序并从您的开发计算机不是手动复制看似随意的文件夹到您的服务器之间的很好的平衡。

UPDATE: I have discovered that installing "Visual Studio 2010 Shell (Integrated)" through the IIS Web Platform Installer will install the required build targets. This seems like a nice compromise between not having the entire Visual Studio application installed on your server and not manually copying seemingly arbitrary folders to your server from your dev machine.

这篇关于MSBuild的DeployOnBuild =真不发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 01:30