错误:allowDefinition=“MachineToApplication”超越应用层
关于这个主题有大量的 SO 帖子。到目前为止,解决方案似乎是将 IIS 中的目录配置为应用程序。另一个常见的解决方案是从根文件夹中删除备份的 web.config 文件。
我的问题有所不同,因为我在 IIS Express 上运行,因此无法将该文件夹配置为应用程序。我注意到,每次编译时,我的根目录中都会有一个名为 obj 的文件夹,这会导致问题。所以我每次都必须手动删除它。
@Valamas,在这篇文章中表示他刚刚编写了删除该文件夹的脚本,但是我认为必须有一个更好的方法...错误发生在这一行:
<authentication mode="Forms">
但似乎发生在其他情况下。有人有想法吗?
there are a ton of SO postings on this subject. by far, the solution seems to be to configure the directory in IIS as an application. Another common solution is to remove backup web.config files from folders in the root.
my problem is different because I'm running on IIS Express so there's no way to configure the folder as an application. what I've noticed is that every time I compile, there's a folder called obj in my root which causes the problem. So I have to manually remove it, every time.
@Valamas, in this post indicates he just scripted the removal of that folder but I'm thinking there's got to be a better way... the error occurs for me on this line:
<authentication mode="Forms">
but seems to occur in other instances. ideas anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能在“发布”下构建了项目,然后恢复为“调试”。您应该切换到“发布”并执行干净的解决方案:部分注册为allowDefinition ='MachineToApplication'超出应用程序级别
You probably built the project under 'Release' and then reverted to 'Debug'. You should switch to 'Release' and perform Clean Solution: section registered as allowDefinition='MachineToApplication' beyond application level