Deploy ASP.net MVC web site to Winodws Azure

Source: Internet
Author: User
Keywords HTTP here patch
Last week, my azure invitation code finally arrived, little excited, so immediately to register the account, and successfully deployed a website to Azure.

With the recent learning of the ASP.net MVC framework and the desire to deploy an MVC application to azure, it was assumed that Azure would support MVC, and that the results were not supported after actual deployment.

Later, after several unsuccessful, a little want to give up, but fortunately later saw the following article:

Http://blogs.msdn.com/jnak/archive/2008/11/10/asp-net-mvc-on-windows-azure-with-providers.aspx

Reading this article, it turns out that deploying an MVC application to Azure is actually very simple, and I quickly deployed an application as I said in the steps.

This is the website that I have successfully deployed to azure, we can see the effect first: http://np.cloudapp.net/

In order to facilitate reading, I am here on a simple translation, summed up can have the following points:

1. Create a new empty cloud Service, such as: Mvccloudservice.

    

2. Add a asp.net Mvc application, for example, called Mvcwebrole.

    

3. Uninstall the newly built Mvcwebrole project.

    

4. Right-click to edit Mvcwebrole project file.

    

5. Add <RoleType>Web</RoleType> to the first <PropertyGroup> of the project file and save it. Just like the following:

<project toolsversion= "3.5" defaulttargets= "Build" xmlns= "http://schemas.microsoft.com/developer/msbuild/2003" >
<PropertyGroup>
. . .
<RoleType>Web</RoleType>
<PropertyGroup>

6. Reload the Mvcwebrole project.

    

7. Right-click the Roles node of the Mvccloudservice project and select Add-> Web role Project in Solution

       

Select Mvcwebrole Project

    

8. The final step is also a crucial one.

Since Azure does not have the ASP.net MVC RC2 installed on it, So you have to package system.web.abstractions,system.web.mvc,system.web.routing three DLLs into the service pack, and deploy to Azure to make your site work.

The packaging method is simple, which is to set the replication local property of the 3 DLLs referenced by the Mvcwebrole project to True.

         

Here a asp.net Mvc application, which can be deployed to Azure, has been basically completed, and the final step is no longer verbose, and there are many articles about how to publish an application to Azure.

Personal recommendation for the Azure Services Platform of the Trojan:

Http://www.cnblogs.com/azure/tag/Azure/

Finally in order to facilitate the test, I will follow the above steps to do a good job of sharing the source.

Finally, add that the Azure cloud service project in VS 2008 and the MVC project in the same solution would be the VS 2008 crash, and the solution would be to download a patch with a patch address: https:// Connect.microsoft.com/visualstudio/downloads/downloaddetails.aspx? downloadid=16827&wa=wsignin1.0

But this patch is not available for Windows 7, eh ... I am using windows7, microscope really is to bear a lot of inconvenience ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.