[已解决]两个web.config文件有问题吗? [英] [Solved] Problem with two web.config files?

查看:83
本文介绍了[已解决]两个web.config文件有问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我有一个网站,其中有两个web.config文件,一个位于根文件夹,一个位于子文件夹.
当我编译项目时,它会给出如下错误:-

Dear Friends,

I have a website in which there are two web.config files, one at root folder and one at sub-folder.
When I compile the project it gives an error like this:-

"Error   92  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.  D:\EHRFTP\Dilip\Medical\Website\web.config
"



然后我在网上搜索,发现:-根本原因是web.config中的某些元素不允许子目录级别.所有这些元素都有一个属性:allowDefinition ="MachineToApplication".这意味着我们只能在计算机级别和根应用程序级别定义这些元素." (ref:- http://forums .asp.net/t/1184374.aspx [^ ])

并且要解决上述问题,请删除可能导致此问题的元素(在子目录web.config中).例如:成员资格,roleManager,sessionState,身份验证等.它们可以自动从根web.config继承.

我做了同样的事情,但后来又遇到另一种错误.我还找到了另一种解决方案:-



Then I searched the web and found that:-"The root cause is some elements in web.config don''t allow sub-directory level. All of those elements have an attribute: allowDefinition="MachineToApplication". It means we can only define those elements in machine level and root application level." (ref:-http://forums.asp.net/t/1184374.aspx[^])

and to solve the above issue, please remove the elements (in the sub-directory web.config) which can result in this problem. For example: membership, roleManager, sessionState, authentication, and so on. They can automatically inherits from the root web.config.

I did the same but then I got another type of errors. I also found another solution as:-

Of course we can put web.config in sub folder. However, the authentication section has an attribute: allowDefinition="MachineToApplication". It means we can only define the authentication section in machine level and root application level.
So the solution is to remove this line: <authentication mode="Windows" /> in forms\news\web.config. It can be defined in forms web.config.\



但仍无济于事.任何人都可以给出具体答案来解决特定问题吗?

谢谢

Varun Sareen


OP更新:
好吧,我自己找到了解决方案:-实际上只有一个web.config文件仅在子文件夹中使用,我只需要打开子文件夹外部的解决方案文件即可完成所有工作,应用程序暨网站成功运行.



But still no rescue. Can anyone give a concrete answer to solve the particular issue?

Thanks

Varun Sareen


UPDATE from OP:
Well I found the solution myself:- actually there was only one web.config file that was being used in the sub-folder only and I have to just open the solution file which was present outside the sub-folder that did all the work and application cum website ran successfully.

推荐答案

在此处引用解决方案:

http://forums.asp.net/p/1184374/2019891.aspx [ ^ ]

refer solution here:

http://forums.asp.net/p/1184374/2019891.aspx[^]


好吧,我自己找到了解决方案:-实际上只有一个web.config文件仅在子文件夹中使用,我只需要打开存在于子文件夹之外的解决方案文件,所有工作和应用程序以及网站均成功运行.
Well I found the solution myself:- actually there was only one web.config file that was being used in the sub-folder only and I have to just open the solution file which was present outside the sub-folder that did all the work and application cum website ran successfully.


这篇关于[已解决]两个web.config文件有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆