5

I have a web role that hosts 4 MVC 4 sites. One of the sites (let's call it the API site from now on) uses both MVC and Web API. When I upgrade the web role, the Web API controllers from the API Site returns a 500 Internal Server Error to all requests. The MVC controllers work as expected and I know the request is getting at least as far as the Application_BeginRequest method of the global.asax. I'm not seeing anything logged in my Elmah log. The only hint I have of anything being wrong is the following in the event log:

The application '/' belonging to site '1' has an invalid AppPoolId 'DefaultAppPool' set. Therefore, the application will be ignored.

As web roles use App Pools with guids as identifiers I don't know where this is coming from.

What is most confusing is that once I recycle the app pool for the API site (which is a guid) everything starts working correctly.

I've tried recyling the app pools as part of a startup task on the role, but that doesn't seem to make any difference.

Any suggestions about what I can do to get Web API to start correctly?

sharptooth
  • 167,383
  • 100
  • 513
  • 979
knightpfhor
  • 9,299
  • 3
  • 29
  • 42
  • I suggest you login (Remote desktop) to you VM and check the event log. – Jake Lin Aug 28 '13 at 03:33
  • I have already done that. That's how I got the error I mentioned in the question. There's nothing else significant that I can see. – knightpfhor Aug 29 '13 at 05:09
  • Can you put some trace log to your code to locate which one cause problem. I had similar issue before. But not same as your one. I need to upload the package a lot of times to locate the issue. – Jake Lin Aug 29 '13 at 06:14
  • How many App Pools do you have in your IIS? – Thiago Custodio Aug 29 '13 at 11:38
  • There are 4 app pools with GUID names (one for each site) and the default ".Net 4.5" and ".Net 4.5 Classic" app pools. – knightpfhor Aug 29 '13 at 20:57

1 Answers1

1

I never did find what was causing this issue.

It got to a point where I could deploy from my machine and not get the problem, but my colleague could not.

We tried comparing the contents of the .cspkg files that were produced, but didn't find any differences.

We are now both able to deploy the project with no problems.

My suspicion is that this was resolved when we upgraded the Azure SDK and tools on our machines.

knightpfhor
  • 9,299
  • 3
  • 29
  • 42