简体   繁体   English

如何从子目录引用web.config

[英]How to reference web.config from sub-directory

任何人都可以介意向我详细解释是否可以在子目录中引用ASP.NET应用程序的web.config文件,并且如果可以的话,您可以向我指出正确的方向吗?

It's unclear what your asking — you might want to reword the question to make clear the problem. 目前尚不清楚您要问什么-您可能想重新编码问题以明确问题。 However, in ASP.Net controls, a URL that looks like 但是,在ASP.Net控件中,URL看起来像

/foo/bar/picture.jpg

is absolute and is anchored at the server root. 绝对的 ,并固定在服务器根目录。

A URL that looks like 看起来像的网址

foo/bar/picture.jpg

is relative with respect to the current URL. 对于当前URL是相对的

Finally, URLs that look like 最后,看起来像的网址

~/foo/bar/picture.jpg

are anchored to the root of the current web app. 锚定到当前Web应用程序的根目录。 You might want to take into consideration the fact that web apps can be nested . 您可能需要考虑Web应用程序可以嵌套的事实。

How URLs are referenced really has nothing to do with web.config. URL的引用方式实际上与web.config无关。 There is, however, an search and inheritance hierarchy for config data, along with scoping rules for that data. 但是,存在用于配置数据的搜索和继承层次结构以及该数据的作用域规则。 See the documentation for details . 有关详细信息,请参见文档

Find mydomain.com/folder in IIS. 在IIS中找到mydomain.com/folder。 Right-click it and pick "Convert to application" This will tell IIS to treat /folder as its own application, instead of just another folder inside the mydomain.com application. 右键单击它,然后选择“转换为应用程序”,这将告诉IIS将/ folder视为自己的应用程序,而不是mydomain.com应用程序中的另一个文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM