AzureFeeds - All your Azure feeds in one place.

Sponsors

Monday, July 20, 2009

Associating an ASP.NET Web Application (including MVC) as a Web Role

by jnak via Cloudy in Seattle on 7/20/2009 11:32:00 PM

If you’ve been following along, you’ll remember my post about using an existing ASP.NET Web Application as a Web Role.  We’re now a little smarter in the tools and can allow you to associate any ASP.NET Web Application in the Cloud Service as a Web Role. 

For example, I can create a Cloud Service with just a Worker role, right click on the Solution in Solution Explorer and select Add | New Project and select an ASP.NET Web Application from the Web folder. 

image

This could be *any* ASP.NET Web Application, including derivatives of it like an MVC project, Dynamic Data etc.

For the sake of this demo, I’ll add an ASP.NET MVC Web Application:

image 

I then right click on the Roles node in the Cloud Service project and select Add | Web Role Project in solution…

image

Now instead of just “Web Roles”, you will get a list of all ASP.NET Web Application project types.  In this case, I select the MVC Web Application I created:

image

And there you have it, you are using a new or existing ASP.NET Web Application as a Web Role.

(Note that if you want to use the Service Hosting runtime APIs, you’ll have to add a reference to Microsoft.ServiceHosting.ServiceRuntime.dll yourself.)

image

When I hit F5, I get the behavior I expect, the MVC Application running on the Windows Azure Development Fabric.

image

One additional note: in order for the MVC assemblies to be included in your service package that you will upload to the cloud, make sure you set the copy local property to true for the MVC DLLs (More information here):

  • System.Web.Abstractions
  • System.Web.Mvc
  • System.Web.Routing

We hope this will make using different application types (like MVC, Dynamic Data and others) as well as using your existing ASP.NET applications easier.  Let me know what you think!

email it!bookmark it!digg it!

Original Post: Associating an ASP.NET Web Application (including MVC) as a Web Role

Legal Note

The content of the postings is owned by the respective author. AzureFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on AzureFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us