1

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Emilano
  • 13
  • 4

1 Answers1

2

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.

user94559
  • 59,196
  • 6
  • 103
  • 103