简体   繁体   中英

Windows azure application developing step failed

This is my first time trying to develop a windows azure application on my visual studio 2010. what I have done so far is:

  • Open new project > C# > Cloud.
  • Downloaded the SDK.
  • Add new class with code that only displays my name and age.
  • try to run this code locally and failed!

My questions is:

  • am I able to run the application locally? if yes the how?
  • How can I deploy the application? (I already have an account)

Well for what I see your problem is not your windows azure sdk, the thing is that you are creating a WorkerRole project which is a Class Library type and that won't give you an output, for that you need to create a WebRole project.

here I let you this tutorial, it would show you how to create your first WebRole project.

http://www.dotnetcurry.com/ShowArticle.aspx?ID=801

And this one would show you how to deploy on the cloud

http://www.developerfusion.com/article/125435/deploying-an-azure-application

What type of application are you trying to build? Your error is because you are trying to run a class library, which isn't an executable.

There are primarily two types of applications that are hosted in Azure:

  1. Website - These are just standard ASP.NET WebForms or MVC projects, hosted on Azure. These are the easiest to get going, and with the latest Azure release, require nothing special. Simply create a Web project, and git deploy to your Azure Web Site

  2. Worker Role - Worker roles are usually for background tasks like performing computations, sending emails, distributing work, etc. These can effectively be thought of as console applications that never end.

For example:

while(true)
{
    // do work here
    Thread.Sleep(5000);
}

When developing Azure applications, you need to either create a website (WebForms, MVC, WebAPI), a WCF service, or a console application to run as a background worker. Once you've built the application locally, then you can add an Azure Cloud project, which will handle the actual deployments.

Yes, you can run your application locally: Select the Azure application project in the Solution Explorer, right click, "Set as StartupUp Project" and run

To Publish: goto https://manage.windowsazure.com/ . Create a new web role and download the publishing settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM