Remotely publish ASP.NET 5 to IIS

ⅰ亾dé卋堺 提交于 2019-12-10 17:27:24

问题


I've got an ASP.NET 5 project that I'd like to deploy to a remote server. I don't have remote desktop access to this machine, otherwise I could follow the same method most people use when deploying to IIS.

I'm able to deploy to my IIS 8.5 just fine on the same machine as my development. First I package my project to get the approot and wwwroot directories. Then, I point IIS to my wwwroot, and all works fine.

The problem is trying to deploy remotely. Normally I would zip up my MVC 5 project and use the IIS gui to 'import' an application.

That doesn't work for my MVC 6 project. Either I'm zipping it up incorrectly or MVC 6 projects can't be deployed this way.

How do you publish a vNext application to a remote IIS server?

Edit:

Just FYI, I am using Microsoft's Web Deploy Remote Agent to deploy this to the server. http://www.asp.net/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-(remote-agent)

It works perfectly for MVC 5 apps, because developers can easily deploy web apps and IT can restrict access to the machines, but the problem is trying to deploy MVC 6 apps using this agent.

I'm not questioning how to deploy MVC 6 projects to IIS, because that's already answered Here, this is concerning how to remotely deploy to IIS.


回答1:


I solved this by updating to Web Deploy 3.6. The newest version includes a specialized provider for deploying ASP.NET 5 applications.

Details on how to use it can be found with this blog post: http://azure.microsoft.com/blog/2014/08/11/web-deploy-3-6-beta-released/

The download link is as follows: http://www.microsoft.com/en-us/download/details.aspx?id=43717

Use the contentPathLib provider or enable contentlibextension.

Example usage:

C:\Program Files (x86)\IIS\Microsoft Web Deploy V3> msdeploy -verb:sync -source:iisapp=C:\release\Publish\wwwroot -dest:iisapp="Default Web Site/ExampleApp",computerName=machinename -enablelink:contentlibextension

To my knowledge, there isn't a GUI supporting these deployment methods yet. I assume this is because vNext is in Beta, and is expected to have breaking changes.



来源:https://stackoverflow.com/questions/31571136/remotely-publish-asp-net-5-to-iis

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