次の方法で共有


Cloud Service Project Templates vs Role Project Templates

If you create a new Cloud Service project in Visual Studio but it doesn't contain a Cloud Service project (ccproj), you won't get the Visual Studio integration for building Windows Azure services that you would expect.  For example, you won't get debug/run in the Development Fabric, you won't get integration with the Development Storage service, and you won't get publishing support.

The reason is that you have created a Role project, instead of a Cloud Service Project. Today, you can have 0 or 1 Web Roles (which is an ASP.Net Web Application) and 0 or 1 Worker Roles (which is a UI-less .Net application) in each service.

When you create a new Cloud Service project, make sure you are choosing a template from the "Cloud Service" node and not the Roles node in the New Project dialog:

image

The question would then be, what is the Roles node in the New Project dialog used for?

It's used when you want to:

1) Add a role to an existing Cloud Service project.  For example, the following Cloud Service project contains a web role.  You can use the roles node to add a Worker Role project to that Cloud Service.

image

This will bring up the new project dialog with the Roles node selected.  Out of the box, we only support C# and VB ASP.Net Web Application Web Roles and and C# and VB Worker roles.

image

Likewise, if the Cloud Service contains a Worker Role and not a Web Role, you can add a Web Role to that project in the same way.

2) Replace an existing Role with a new Role Project.  For example, you have a Cloud Service that contains a Web Role, and you want to replace it with a new Web Role.  You can right click on the Web Role association and select to associate it with a new Web Role:

image

This will bring up the the new project dialog with the Roles node selected:

image 

The final thing you can do, is associate a role with an existing Role project by adding that Role project to the solution, right clicking on either the Web or Worker role association node in Solution Explorer and select to associate that role with a "Role Project in solution..."

Comments

  • Anonymous
    October 27, 2008
    Jim has posted a couple of posts on troubleshooting some issues you may run into when trying the Windows

  • Anonymous
    October 31, 2008
    As you already noticed, Windows Live Tools – November 2008 CTP is available and introduces templates

  • Anonymous
    October 31, 2008
    In my prior post that talked about the difference between the Cloud Service templates and the Role templates

  • Anonymous
    November 05, 2008
    If you're using the Windows Azure Tools for Microsoft Visual Studio and you are finding that when you

  • Anonymous
    December 17, 2008
    Wanna learn about the future of software + services well wait no longer Windows Azure is here and below