将解决方案升级到.NET Framework 4.5后,每日部署停止工作 [英] After upgrading solution to .NET framework 4.5 the daily deploy stopped working

查看:75
本文介绍了将解决方案升级到.NET Framework 4.5后,每日部署停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经成功地使用TFS2010中的msdeploy每天更新我们的开发网站.

We have with success been updating our development web site at a daily basis using msdeploy from TFS2010.

在我们升级到VS2012,将应用程序从.NET Framework 4.0升级到4.5,将ASP.NET MVC从3.0升级到4.0之前,它一直运行良好.看起来一切都很好,已经部署了程序集,但实际上尚未部署任何东西.

This was working fine until we upgraded to VS2012, our application from .NET Framework 4.0 to 4.5 and ASP.NET MVC from 3.0 to 4.0. It look like all is well and assemblies deployed but nothing has actually been deployed.

我已经研究了两天,无法弄清楚为什么会发生这种情况,现在我的想法已经用光了.

I have been looking into this for two days now and can't figure out why this is happening and now I am running out of ideas.

下面是升级之前工作方式的一部分,这是我的构建脚本的一部分.

Below is part of my build script in the way it has been working before the upgrade.

<MSBuild
                Projects="$(SolutionRoot)\My.Web\My.Web.csproj"
                Properties="MvcBuildViews=False;AllowUntrustedCertificate=True;AuthType=Basic;Configuration=Dev;CreatePackageOnPublish=True;DeployIisAppPath=dev.myweb;DeployOnBuild=True;DeployTarget=MsDeployPublish;MSDeployPublishMethod=WMSvc;MsDeployServiceUrl=https://10.xxx.xxx.xxx:8172/MsDeploy.axd;UserName=UserName;Password=Password;UseMsdeployExe=True"
                ContinueOnError="False"
                />

启动升级并发现我的问题时,我们正在使用Web Deploy 2.0,但现在我们已升级到Web Deploy 3.0.我还确保我们正在使用ToolsVersion="4.0"进行构建.

When the upgrade was initiated and my problem discovered we were using Web Deploy 2.0 but now we have upgraded to Web Deploy 3.0. I have also made sure we are building with ToolsVersion="4.0".

更新-

msbuild.exe/p:AllowUntrustedCertificate =真 /p:AuthType =基本 /p:配置=开发 /p:CreatePackageOnPublish =真 /p:DeployIisAppPath=dev.myweb /p:DeployOnBuild =真 /p:DeployTarget = MsDeployPublish /p:MSDeployPublishMethod = WMSvc /p:MsDeployServiceUrl=https://10.xxx.xxx.xxx:8172/MsDeploy.axd /p:用户名=用户名 /p:密码=密码 /p:UseMsdeployExe =真 E:\ Builds \ 1 \ WhatEver \ Daily_Build \ Sources \ My.Web \ My.Web.csproj

msbuild.exe /p:AllowUntrustedCertificate=True /p:AuthType=Basic /p:Configuration=Dev /p:CreatePackageOnPublish=True /p:DeployIisAppPath=dev.myweb /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSvc /p:MsDeployServiceUrl=https://10.xxx.xxx.xxx:8172/MsDeploy.axd /p:UserName=UserName /p:Password=Password /p:UseMsdeployExe=True E:\Builds\1\WhatEver\Daily_Build\Sources\My.Web\My.Web.csproj

现在,我还尝试从TFS运行上述msbuild命令,但没有任何响应使我完全沮丧. TFS的事件日志中什么也没有,无论详细程度如何,日志文件中什么也没有...有什么想法吗?

Now I also tried to run the above msbuild command from our TFS and no response which frustrates me completely. Nothing in the event log of TFS, nothing in log file no matter verbosity... Any ideas?

它确实可以直接使用msdeploy进行工作,如下所示;

It does work using msdeploy directy like below;

<Exec Command="&quot;C:\Program Files\IIS\Microsoft Web Deploy V3\MSDeploy.exe&quot; -verb:sync -source:contentPath=&quot;E:\Builds\1\WhatEver\Daily_Build\Sources\My.Web\My.Web.csproj&quot; -dest:contentPath=&quot;E:\dev.my.web&quot;,computername=https://10.xxx.xxx.xxx:8172/MsDeploy.axd,username=UserName,password=Password,authtype=Basic -allowUntrusted=True"
              ContinueOnError="false" />

-

更新2- 由于输出类型为类库,因此Microsoft似乎检查了哪些类型的项目属于可发布项目,而我们的Web应用程序不是.这在v4.0中有效,但显然不适用于v4.5.

UPDATE 2 -- It appears Microsoft added a check for what type of projects that are publishable projects and our web application are not, since the Output Type is Class Library. This has been valid with v4.0 but apparently not for v4.5.

任何人都知道如何使它重新工作?我需要更改项目类型吗?预先创建发布包,然后进行部署?还是什么?

Anyone have an idea of what to do make it work again? Do I need to change the project type? Create publishing package up front and then deploy that? Or what?

-

还有其他人遇到过同样的问题吗?您找到共享的解决方案了吗?

Anyone else that has had the same problem? Have you found a solution to share?

MSBuild版本是否有问题?

Could there be an issue with version of MSBuild?

推荐答案

以下是我的建议.在VS2012中,我们使使用由发布对话框创建的发布配置文件自动发布Web项目变得容易.根据您的情况,创建一个新的MSDeploy配置文件.创建该配置文件时,我们会将设置保存到Properties \ PublishProfiles(或VB的My Project \ PublishProfiles)下的文件中.该文件的扩展名将是.pubxml.这些文件实际上是MSBuild文件,您可以根据需要对其进行自定义.您也可以继续使用发布"对话框.密码将存储在.user文件中并进行加密,以便只有您可以解密.

Here is what I would recommend. In VS2012 we have made it easy to automate publishing your web projects using the publish profiles which are created by the publish dialog. In your case create a new MSDeploy profile. When you create that profile we will save the settings into a file under Properties\PublishProfiles (or My Project\PublishProfiles for VB). The extension of this file will be .pubxml. Those files are actually MSBuild files, which you can customize if needed. You can continue to use the publish dialog as well. The password will be stored in a .user file and encrypted such that only you can decrypt it.

创建该配置文件后,如果要构建.sln文件,则可以使用以下命令进行发布.

After you have created that profile you can publish with the command below if you are building the .sln file.

msbuild mysoln.sln /p:DeployOnBuild=true /p:PublishProfile=<ProfileName> /p:Password=<Password>

如果您要构建.csproj/.vbproj,则需要按照以下方式进行一些调整

If you are building the .csproj/.vbproj then you need to tweak this a bit in the following way

msbuild mysoln.sln /p:DeployOnBuild=true /p:PublishProfile=<ProfileName> /p:Password=<Password> /p:VisualStudioVersion=11.0

有关为何需要VisualStudioVersion的更多信息,请访问 http://sedodream.com/2012/08 /19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx .

More on why VisualStudioVersion is required at http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx.

完成此操作后,您将可以像以前一样进行构建和发布.仅供参考,我们已经在Azure SDK https:/中为VS2010提供了所有这些新的Web发布功能. /www.windowsazure.com/zh-CN/develop/net/# .

Once you do this you will be able to build+publish just like you did previously. FYI we have shipped all these new web publish features for VS2010 in the Azure SDK https://www.windowsazure.com/en-us/develop/net/#.

在您的问题中,我还注意到您正在指定一些自定义属性,例如MvcBuildViews.现在,您可以根据需要将这些属性直接放置在发布配置文件(.pubxml文件)中.当然,如果您的情况更合理,您仍然可以在命令行中传递它们.

Also in your question I noticed that you are specifying some custom properties, like MvcBuildViews. You can now place those properties directly inside the publish profile (the .pubxml file) if you want. Of course you can still pass them in on the command line if that makes more sense for your scenario.

有关详细信息,请参见 http://sedodream.com/2012/06/15 /VisualStudio2010WebPublishUpdates.aspx .

More info on this at http://sedodream.com/2012/06/15/VisualStudio2010WebPublishUpdates.aspx.

如果您查看开发人员要实现自动化发布的方法,那就是指定在构建过程中要执行的属性和目标.这种方法的问题在于,这限制了我们增强Web发布体验的能力.在新版本中,我们引入了一个抽象,即发布配置文件,它使我们能够更改Web发布管道的基础目标,并且您的自动化脚本将继续运行.希望从现在开始,您不必重新访问此问题.

If you take a look at the approach that we had for developers to automate publishing it was to specify properties and targets to be executed during the build. The problem with this approach is that this limits our ability to enhance the web publish experience. In the new release we have introduced an abstraction, the publish profile, which allows us to change the underlying targets of the web publish pipeline and your automation scripts will continue to run. Hopefully from this point forward you will not have to re-visit this issue.

这篇关于将解决方案升级到.NET Framework 4.5后,每日部署停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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