在 VS2012 上使用 MSBuild 从命令行部署到 FTP 不起作用,没有错误 [英] Deploying to FTP from command line using MSBuild on VS2012 not working, no errors

查看:29
本文介绍了在 VS2012 上使用 MSBuild 从命令行部署到 FTP 不起作用,没有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从命令行执行发布配置文件.

I'm trying to execute the publish profile from the command line.

  1. 在 Visual Studio 中创建发布配置文件(右键单击项目 -> 发布)
  2. 已验证它有效.当我按下发布时,这些东西会去它应该去的地方(FTP 站点)

现在我想从 TFS 执行此操作,这意味着 MSBuild.

Now I'd like to do this from TFS and that means MSBuild.

从命令行,我试过这个:

From the command line, I tried this:

msbuild.exe WebApplication1.csproj /p:DeployOnBuild=true;PublishProfile="ftp";Password={INSERT-PASSWORD}

我没有收到任何错误.并且这些文件不会发布在 FTP 站点上.发布配置文件的名称是 ftp.pubxml.它实际上在这里:

I receive no error. And the files are not published on the FTP site. The name of the publish profile is ftp.pubxml. It is physically here:

WebApplication1\Properties\PublishProfiles\ftp.pubxml

这是 Visual Studio 2012 默认放置的位置.

That's where Visual Studio 2012 puts it by default.

我使用的是 FTP 部署,而不是 Web 部署.没有单击一次.很多网上的东西都在谈论这两个.这是一个无聊的旧 FTP 部署.

I'm using FTP deploy, not Web Deploy. No Click Once. A lot of the stuff online talks about those two. This is a boring, old FTP deploy.

此处有关 SO 的相关问题

推荐答案

我刚刚在 http://sedodream.com/2013/01/06/CommandLineWebProjectPublishing.aspx 希望能为您解决这个问题.

I have just posted a blog at http://sedodream.com/2013/01/06/CommandLineWebProjectPublishing.aspx which will hopefully clear this up for you.

命令行不支持 FTP 发布.您会收到一条错误消息,让您知道这一点,但是您的命令行缺少一个非常重要的属性

FTP publishing is not supported on the command line. You would receive an error letting you know this, but your command line is missing one very significant property

/p:VisualStudioVersion=11.0

我在 http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx.总而言之,引入了 VisualStudioVersion 属性以允许 VS 2010 和 VS 2012 共享项目文件和解决方案.如果您不为此属性指定值,则默认为 10.0.

I have blogged about this property in more detail at http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx. To summarize this, the VisualStudioVersion property was introduced to allow VS 2010 and VS 2012 share project files and solutions. If you do not specify a value for this property, it will be defaulted to 10.0.

就您而言,由于您正在构建项目,因此您需要指定此属性.由于您没有指定该值,因此默认为 10.0,并且使用的构建+发布过程来自 VS 2010.显然您的机器上安装了 VS2010 + VS2012.

In your case, since you are building the project you will need to specify this property. Since you didn't specify the value, it defaulted to 10.0 and the build+publish process used was that from VS 2010. Evidently you have both VS2010 + VS2012 installed on your machine.

如果您传入了属性/p:VisualStudioVersion=11.0,您会收到的错误应该让您知道命令行不支持 FTP 发布.

If you passed in the property /p:VisualStudioVersion=11.0 the error you would have received should let you know that FTP publishing is not supported from the command line.

注意:如果您确实希望我们支持 FTP 的命令行发布,最好的做法是在 aspnet 上提出建议.uservoice.com.

Note: If you do want us to support command line publishing for FTP the best thing to do is open a suggestion at aspnet.uservoice.com.

这篇关于在 VS2012 上使用 MSBuild 从命令行部署到 FTP 不起作用,没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆