Freigeben über


Windows Azure Tools: Getting the right Run/Debug and Publish Functionality

If you're using the Windows Azure Tools for Microsoft Visual Studio and you are finding that when you hit F5 or Ctrl+F5 you are getting the ASP.Net Development server:

image

Instead of the Development Fabric and Development Storage services:

image image

You need to make sure that the startup project in Visual Studio is set to the ccproj that was added when you created a Cloud Service.  Notice below how the CloudService22 project is bold, which indicates that it is the startup project.

image

You can set the startup project by right clicking on a project and selecting "Set as StartUp Project":

image

A useful setting to look at it in the Solution property pages (right click on the solution node in the Solution Explorer and click "Properties") is the Common Properties -> Startup Project.

image

Having this set to "Single startup project" and selecting the Cloud Service (ccproj) project is the way to go.  Having it set to the "Current Selection" causes the startup project to change whenever you activate a file in a different project.

Cloud Service projects should have this set to a single startup project already.

If you don't have a Cloud Service project in your solution, make sure that when you created your Cloud Service project, that you selected a template from the Cloud Service node and not the Roles node in the New Project -> Project types dialog:

image

See my post on the different between Cloud Service and Role Templates for more information.

A Related Note on Publish

When hitting "Publish" to create the cspkg file that you upload to the Azure Services Development Portal to deploy your Cloud Service on Windows Azure, you need to make sure that you publish on the Cloud Service project and not the Web Role.

image

Otherwise you'll get this dialog, which is not what you want when working on Windows Azure services:

image

This can be especially confusing when you use the Build -> Publish option:

image 

This is context sensitive to the selected project (not startup project) -- so just make sure the name to the right of the Publish action corresponds to the name of your Cloud Service project.

Comments

  • Anonymous
    November 05, 2008
    Jim posted a few tips on making sure you get the right behavior on run/debug and publish when using the

  • Anonymous
    November 06, 2008
    I finally got some hands on time with Windows Azure. No I don't mean using the SDK and the Hands

  • Anonymous
    December 16, 2008
    This last week, I have been concentrating my free time in Azure. I found the cloud will provide developers

  • Anonymous
    January 10, 2009
    Thank you for submitting this cool story - Trackback from DotNetShoutout