Emilano
Emilano

Reputation: 13

ServerManager class, my site is not in the Site Collection on Azure Compute Emulator

I have a WebRole named Web, and I am running this code in the Azure Compute Emulator:

    public override bool OnStart()
    {
        using (var serverManager = new ServerManager())
        {
            string strSiteName = RoleEnvironment.CurrentRoleInstance.Id + "_" + "Web";
            Site theSite = serverManager.Sites[strSiteName];

        }
        return base.OnStart();
    }

but serverManager.Sites only returns sites located in my local IIS, but I need the site hosted in Windows Azure Emulator.

Any suggestions?

Upvotes: 1

Views: 335

Answers (1)

user94559
user94559

Reputation: 60153

I think the emulator uses IIS Express by default these days. I bet that if you switch it to use full IIS (somewhere in the cloud project's properties, IIRC), things will work as expected.

Upvotes: 2

Related Questions