我正在在mvc3中开发一个应用程序( http://www.colombiatrolley.com/sitrolley)。在我的电脑中它可以正确运行,但是当我将其上传到服务器(托管服务)时,我收到此错误:

解析器错误消息:使用注册为allowdefinition='machinetoApplication'之外的excowtedfinition的部分是错误的。此错误可能是由虚拟目录未配置为IIS中的应用程序的虚拟目录引起的。

我知道这是一个非常常见的错误,但我还没有修好它。

有帮助吗?

解决方案

Some config sections are only allowed at the "root" of the application, then authentication section is one of them.

You need to configure IIS to run your your site as an application, not a sub-directory in an existing application.

For IIS 7+, right click the directory that contains your web application, and select "Convert to Application".

EDIT:

Arie van Someren is right. Looking carefully at your error, you want the <authentication> configuration to be in the web.config one level up, not the web.config in Views.

其他提示

I had the same problem. I solved it by deleting the obj folder that appeared after doing a "Build > Publish".

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top