ASP.NET 5 (vNext) Deployment via TFS 2015

折月煮酒 提交于 2020-01-01 10:04:24

问题


We're trying to work through the new tool chain for building and deploying an ASP.NET 5 (vNext) CoreCLR web site to a server cluster. Between the new compilation changes and the changes to TFS, I'm not sure how everything now gets built and deployed. The scenario is as follows:

  1. On-premise TFS for source control and build agent
  2. Targeting ASP.NET 5 under CoreCLR, hosted via IIS

Questions are:

Using TFS for continuous integration builds (and hopefully deployment to an on-premise IIS server), how does one build and deploy this new application type?

It seems like MSBuild might still be usable to point at a .sln file so as to indirectly invoke dnu.exe, is that correct? Is that the appropriate way to do that now?

Should we be running a scripted build task instead to run dnu.exe instead?

How are these new CoreCLR builds deployed? Just a straight copy to a directory on a remote machine?

This is a new application and we're using a multi-layered application architecture, where the DAL and Business logic are in their own CoreCLR projects, if that makes a difference.

Thanks in advance for shedding some light on the situation.


回答1:


Here is what we ended up doing:

  1. Powershell script "prebuild.ps1" as per the previous answer and Microsoft deployment guidelines: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5

  2. Vanilla MSBuild build. no switches or special settings.

  3. Powershell script to execute xUnit test runner. We used guidance from this post at http://fluentbytes.com/running-xunit-test-with-asp-net-dnx-and-tfs-2015-build/

  4. Powershell script to run "dnu publish". This creates a directory of the entire web application's structure.

  5. "Windows File Copy" task to deploy the directory structure created in #4 to all of the target machines in the test environment.




回答2:


To build and deploy ASP.NET 5 via TFS2015 vNext build system, you need to:

1). Create a PowerShell script (named Prebuild.ps1, for example) to install DNX. Details of the PowerShell script can be found: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5 . Add the script file into TFS version control.

2). Add the PowerShell script build step into build definition. Run the Prebuild.ps1 script in this step:

3). In the MSBuild step, specify the project needs to be built, and add the following /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=InProc /p:MsDeployServiceUrl=localhost /p:DeployIisAppPath="Default Web Site/TFSTest1" /p:VisualStudioVersion=14.0 to publish the project to IIS.



来源:https://stackoverflow.com/questions/33622661/asp-net-5-vnext-deployment-via-tfs-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!