ASP。NET网站Project auto deploy with TFS 2013 build。

时间:2023-01-17 09:17:24

I have a ASP.NET Webforms Website project(note this is NOT WebApplication project i.e. there is no .csproj).

我有一个ASP。NET Webforms网站项目(注意这不是WebApplication项目,即没有。csproj)。

I want to do a auto deploy, file system to our network share.

我想做一个自动部署,文件系统到我们的网络共享。

I created a profile and so there is website.publishproj file and profile xml.

我创建了一个个人资料,所以有了网站。publishproj文件和概要xml。

I tried adding this in MSBuild arguments in Build Definition:

我尝试在构建定义中添加MSBuild参数:

website.publishproj /p:DeployOnBuild=true /p:PublishProfile=MyDevProfile /p:VisualStudioVersion=12.0

的网站。publishproj / p:DeployOnBuild = true / p:PublishProfile = MyDevProfile / p:VisualStudioVersion = 12.0

I get this error:

我得到这个错误:

MSBUILD : error MSB1008: Only one project can be specified. Switch: website.publishproj

MSBUILD: error MSB1008:只能指定一个项目。开关:website.publishproj

Any idea what am I doing wrong? I believe this has something to do with Website project type.

你知道我做错了什么吗?我认为这与网站项目类型有关。

This is something I read: How to use command line msbuild to deploy VS2012 Web Site project without precompiling it?

这是我读到的:如何使用命令行msbuild在不预先编译的情况下部署VS2012 Web站点项目?

Here is the command:

这是命令:

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "E:\Builds\1\TP1\MyWebsite_Dev\src\Websites\MyWebsite\MyWebsite.sln" /nr:False /fl /flp:"logfile=E:\Builds\1\TP1\MyWebsite_Dev\src\Websites\MyWebsite\MyWebsite.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true website.publishproj /p:DeployOnBuild=true /p:PublishProfile=DropToDemoProfile /p:VisualStudioVersion=12.0 /m /p:OutDir="E:\Builds\1\TP1\MyWebsite_Dev\bin\" /p:VCBuildOverride="E:\Builds\1\TP1\MyWebsite_Dev\src\Websites\MyWebsite\MyWebsite.sln.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/35;IgnoreDuplicateProjects=False;InformationNodeId=13;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;LogWarnings=True;TFSUrl=http://mytfs:8080/tfs/colletionname;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;" /p:BuildId="7d23530d-7349-406f-98b7-5d4f0b9f4101,vstfs:///Build/Build/35" /p:BuildLabel="MyWebsite_Dev_20141122.13" /p:BuildTimestamp="Sun, 23 Nov 2014 01:22:05 GMT" /p:BuildSourceVersion="LMyWebsite_Dev_20141122.13@$/TP1" /p:BuildDefinition="MyWebsite_Dev"

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /不带标识/ noconsolelogger”构建E:\ \ 1 \ TP1 \ \ MyWebsite \ MyWebsite MyWebsite_Dev \ src \网站。sln \ nr:False /fl /flp:“logfile=E:只\1\TP1\MyWebsite_Dev\src\网站\MyWebsite.log;encoding=Unicode;verbosity=normal”/p:SkipInvalidConfigurations=true website。发布proj /p:DeployOnBuild=true / myp:PublishProfile=DropToDemoProfile /p:VisualStudioVersion=12.0 /m /p:OutDir="E: OutDir="E:\构建1\TP1\MyWebsite_Dev\ website_\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \bin\ \ \ \ \ \ \ \ \ \ \ \ \ \ \b \ p \ p \ p \ p \ p \ p \ p \ p \mso - fareast - font - family:宋体;mso - bidi - font - family: " times new roman "; mso - bidi - theme - font:"*WorkflowForwardingLogger "C:\程序文件\Microsoft TeamFoundation Server 12.0\工具\ microsoft.teamfoundation.build.server.logger ";"Verbosity=Normal "/p:“7d23530d- my349 -406f-98b7-5d4f0b9f4101,vstfs:///Build/ 35”/p:“MyWebsite_Dev_20141122.13”

2 个解决方案

#1


2  

You're trying to build the solution (MyWebsite.sln) and the project (website.publishproj) simultaneously as part of the same MSBuild command at least according to the arguments being passed.

您试图同时构建解决方案(MyWebsite.sln)和项目(website.publishproj),作为MSBuild命令的一部分,至少根据所传递的参数。

You can run msbuild website.publishproj /pp:website.pp.publishproj to see what targets you can call in website.pp.publishproj or what properties to override.

你可以运行msbuild网站。publishproj / pp:website.pp。publishproj查看可以在website.pp中调用哪些目标。publishproj或要重写的属性。

You can run set MSBUILDEMITSOLUTION=true && msbuild MyWebsite.sln to see what targets you can call in MyWebsite.sln.metaproj and MyWebsite.metaproj or what properties to override.

您可以运行set MSBUILDEMITSOLUTION=true & msbuild MyWebsite。你可以在MyWebsite.sln中看到什么目标。metaproj MyWebsite。metaproj或什么属性可以覆盖。

Your DeployOnBuild command is fine and should work, I'm guessing your TFS build config is pointing to the .sln and passing website.publishproj as an argument rather than the primary target of the build, so either repoint it to build the .publishproj directly or... well, there doesn't seem to be any alternative, you can try adding a new configuration and editing the .sln with new AspNetConfiguration and MyDevProfile.AspNetCompiler.TargetPath but then you're just asking for trouble.

您的DeployOnBuild命令很好,应该可以工作了,我猜您的TFS构建配置指向.sln并传递网站。publishproj是一个参数,而不是构建的主要目标,因此要么将其重新指向,直接构建.publishproj,要么……似乎没有其他选择,您可以尝试添加一个新的配置,并使用新的AspNetConfiguration和MyDevProfile.AspNetCompiler来编辑.sln。TargetPath但是你只是在自找麻烦。

#2


0  

You need to upgrade your Web Site to a Web Application in order for any of this to be automatic.

您需要将您的Web站点升级到Web应用程序,以便自动完成这些操作。

Its a fairly simple procedure and even on sites with thousands of pages I have completed the migration in only a few days of one persons time without impacting other devs.

这是一个相当简单的过程,即使是在拥有数千页的站点上,我也只花了几天时间就完成了迁移,不会影响到其他开发人员。

Web Site functionality has been feature complete for over 10 years. While it still existing in the product for back-compat I would not recommend using it.

网站功能已经完成超过10年。虽然它仍然存在于backcompat产品中,但我不建议使用它。

#1


2  

You're trying to build the solution (MyWebsite.sln) and the project (website.publishproj) simultaneously as part of the same MSBuild command at least according to the arguments being passed.

您试图同时构建解决方案(MyWebsite.sln)和项目(website.publishproj),作为MSBuild命令的一部分,至少根据所传递的参数。

You can run msbuild website.publishproj /pp:website.pp.publishproj to see what targets you can call in website.pp.publishproj or what properties to override.

你可以运行msbuild网站。publishproj / pp:website.pp。publishproj查看可以在website.pp中调用哪些目标。publishproj或要重写的属性。

You can run set MSBUILDEMITSOLUTION=true && msbuild MyWebsite.sln to see what targets you can call in MyWebsite.sln.metaproj and MyWebsite.metaproj or what properties to override.

您可以运行set MSBUILDEMITSOLUTION=true & msbuild MyWebsite。你可以在MyWebsite.sln中看到什么目标。metaproj MyWebsite。metaproj或什么属性可以覆盖。

Your DeployOnBuild command is fine and should work, I'm guessing your TFS build config is pointing to the .sln and passing website.publishproj as an argument rather than the primary target of the build, so either repoint it to build the .publishproj directly or... well, there doesn't seem to be any alternative, you can try adding a new configuration and editing the .sln with new AspNetConfiguration and MyDevProfile.AspNetCompiler.TargetPath but then you're just asking for trouble.

您的DeployOnBuild命令很好,应该可以工作了,我猜您的TFS构建配置指向.sln并传递网站。publishproj是一个参数,而不是构建的主要目标,因此要么将其重新指向,直接构建.publishproj,要么……似乎没有其他选择,您可以尝试添加一个新的配置,并使用新的AspNetConfiguration和MyDevProfile.AspNetCompiler来编辑.sln。TargetPath但是你只是在自找麻烦。

#2


0  

You need to upgrade your Web Site to a Web Application in order for any of this to be automatic.

您需要将您的Web站点升级到Web应用程序,以便自动完成这些操作。

Its a fairly simple procedure and even on sites with thousands of pages I have completed the migration in only a few days of one persons time without impacting other devs.

这是一个相当简单的过程,即使是在拥有数千页的站点上,我也只花了几天时间就完成了迁移,不会影响到其他开发人员。

Web Site functionality has been feature complete for over 10 years. While it still existing in the product for back-compat I would not recommend using it.

网站功能已经完成超过10年。虽然它仍然存在于backcompat产品中,但我不建议使用它。