Mikayil Abdullayev
Mikayil Abdullayev

Reputation: 12367

Getting "A default document is not configured " error when deploying ASP.NET MVC application on IIS 7.5

Developing an ASp.NET MVC 5 application. Runs without an issue on the development machine (Windows 7 x86). When I tried to deploy it on IIS 7.5 (Win Server 2008 R2 64 bit) I got 3 errors:

  1. Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

I fixed this issue by removing targetFramework="4.5" from

<compilation debug="true" targetFramework="4.5">
  1. The tag contains an invalid value for the 'culture' attribute.

I don't know why but compliant was about the following entry:

<globalization enableClientBasedCulture="true" culture="az-Latn" uiCulture="az-Latn" />

After removing culture="az-Latn" uiCulture="az-Latn" this problem also got solved. But I don't think this is a proper way of solving that, so it'd be good to know the right solution.

  1. Now the third error is the one that's taken all my day. After solving the above two problems now I get the error in the image:

The best solution that seems to work for almost everybody is to add the following entry:

    <modules runAllManagedModulesForAllRequests="true" />

But I already have it in the config file. IIS was missing URLRewrite module so I installed it manually.(Don't know if this has anything to do with it though). Didn't help. Enabled 32 bit Applications. Didn't help. What else should I try?

enter image description here

Upvotes: 2

Views: 2596

Answers (1)

DavidG
DavidG

Reputation: 118947

There are two possible solutions

  1. Make sure the application pool that is running your site is set to version 4. It's likely defaulted to v2 which will give you all the errors you mentioned in the question.

  2. Re-register your framework with this command:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -i

I'd also revert those changes you have made (e.g. put the targetFramework attribute back in)

Upvotes: 3

Related Questions