hbulens hbulens - 1 year ago 253
ASP.NET (C#) Question

ASP.NET MVC 5 Service Unavailable

I have been working on a VS2015 solution for the last year and a half until suddenly I can't debug my ASP.NET MVC 5 application any more. As I hit F5, the application opens a new tab in the browser and only renders this:

The service is unavailable.

In the event logs, I get to see this:

Event code: 1002
Event message: Application is shutting down. Reason: Initialization error.
Event time: 19/09/2016 7:08:40
Event time (UTC): 19/09/2016 12:08:40
Event ID: 441a1c0336a84c5ba5660270208e832e
Event sequence: 3
Event occurrence: 1
Event detail code: 50014

Application information:
Application domain: /LM/W3SVC/2/ROOT-1-131187604982350160
Trust level: Full
Application Virtual Path: /
Application Path: *ommitted*
Machine name: *ommitted*

Process information:
Process ID: 1892
Process name: iisexpress.exe
Account name: *ommitted*

Custom event details:

I use IIS Express 10 for my development. During the process, only 1 warning arises in the tracing log files:

ModuleName: AspNetInitializationExceptionModule
Notification: BEGIN_REQUEST
HttpStatus: 503
HttpReason: Service Unavailable
ErrorCode: De bewerking is voltooid. (0x0)

The VS 2015 application config file site's config:

<site name="MyApp" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Source\MyApp" />
<binding protocol="http" bindingInformation="*:52543:localhost" />

I also looked at the URL reservations as suggested here but there aren't any urls containing port 52543. I tried to change the port altogether but the result is the same, so I don't think this is the issue.

I can't recall doing anything differently. I created a new ASP.NET Core project but that shouldn't be the root cause. This issue doesn't seem to appear in my other projects, so it's only this solution.

Lastly, the debugging process kicks off well as it hits the constructor of the MVC application (child class of the HttpApplication), but as soon as the constructor has finished, nothing happens any more after that.

Any suggestions?

Answer Source

Apparently the issue was only temporarily, I can't really tell what happened. The only thing I did to make it work was to add this entry to the config:

 <binding protocol="http" bindingInformation="*:52543:myipaddress" />

After I ran the solution once, it seemed IIS Expressed suddenly remembered how to to do its job again, making the entry above redundant.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download