I'm trying to set up ASP.net MVC4, hosting it with IIS7.
When performing a get request to my API, I get the following error:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication'
beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 27: <system.web>
Line 28: <compilation debug="true" targetFramework="4.0" />
Line 29: <authentication mode="None" />
Line 30: <pages>
Line 31: <namespaces>
Source File: C:\inetpub\wwwroot\api\web.config Line: 29
Line 29 is highlighted in red. Any help would be greatly appreciated
Joe
In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services. On the Select Role Services page of the Add Role Services Wizard, select Basic Authentication, and then click Next. On the Confirm Installation Selections page, click Install. On the Results page, click Close.
When using impersonation, ASP.NET applications can execute with the Windows identity (user account) of the user making the request. Impersonation is commonly used in applications that rely on Microsoft Internet Information Services (IIS) to authenticate the user. ASP.NET impersonation is disabled by default.
you cannot define authentication mode in the config file (web.config) in IIS7 unless you 'allow' it by updating the machine.config. Instead change the authentication settings in the IIS7 Management console.
http://technet.microsoft.com/en-us/library/cc733010(v=ws.10).aspx
MORE: The 'authentication' web.config settings are required to configure authentication in IIS Express, but they should be omitted when deploying to IIS.
To support this sort of configuration in IIS Express you must 'allow authentication' by changing the applicationHost.config
MORE: http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With