继承web.config ASP.NET 2.0

编程入门 行业动态 更新时间:2024-10-14 00:28:43
本文介绍了继承web.config ASP.NET 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一组我希望由多个 网站继承的设置。 我正在尝试这个,但是它没有用。 wwwroot \ group\web.config wwwroot \ group \site1 \web.config wwwroot \ group \site2 \web.config 其中site1& site2是应用程序。 我尝试将组成为子网站,应用程序和子网站以及 应用程序。无论如何,site1和site2都没有看到来自 的设置了.\\web.config。 有趣的是,如果我制作我对wwwroot \web.config的更改然后是site1& site2查看更改。当然有一个问题,更改是2.0和 服务器仍在运行1.1个站点所以在 wwwroot \web.config中的2.0设置会破坏所有1.1网站:( 我愿意接受任何建议,谢谢! Ben

I have a group of settings that I''d like to have inherited by multiple sites. I''m trying this, but it''s not working. wwwroot\group\web.config wwwroot\group\site1\web.config wwwroot\group\site2\web.config Where site1 & site2 are applications. I have tried making group a subweb, an application and a subweb and application. No matter what, site1 and site2 don''t see the settings from the group\web.config. The funny thing is if I make my changes to wwwroot\web.config then site1 & site2 see the changes. There is of course a catch, the changes are 2.0 and the server is still running 1.1 sites so the 2.0 settings in the wwwroot\web.config break all of the 1.1 sites :( I''m open to any suggestions, thanks! Ben

推荐答案

你好Ben, 欢迎来到ASP.NET新闻组。 来自你的描述,您已经在IIS网站下托管了多个ASP.NET 2.0和1.1 Web 应用程序。那些ASP.NET 2.0 Web应用程序 位于同一个父目录下IIS虚拟路径。目前 你试图在web.config 文件中存储一些共享配置信息,这些文件位于那些ASP.NET 2.0应用程序的父目录中,所以那个 他们可以自动继承他们的设置,对吗? 根据我的理解, $ b $自然支持这种继承b A. SP.NET应用程序(1.1和2.0)。以下MSDN文档 描述了这种配置继承的一般规则: #ASP.NET配置文件层次结构和继承 msdn2.microsoft/en-us/library/ms178685 .aspx 对于您的方案,我认为问题可能由以下因素引起: 1.如何通过物理子目录或映射的外部 物理路径创建的目录(从IIS站点根目录到子 应用程序)?例如在你的情况下,完整的路径是wwwroot \group \siteX 然后,是组是什么。目录是一个物理子目录wwwroot(网站 root)?我已经进行了一些本地测试,如果是组,文件夹是一个 物理子目录(不一定是应用程序虚拟目录), 其中的web.config设置将由任何子ASP.NET继承 下的应用程序(无论是通过物理子目录还是映射的 虚拟目录poinetd到外部物理路径)。 2。您将在父级 web.config文件中分享哪些配置部分?我的本地测试使用< connectionStringssection作为继承的 ,它运行良好。你打算分享相同的 设置或任何特殊配置设置吗? 无论如何,如果有什么我可以随时告诉我如果您的方案中存在任何特殊问题,我们会错过或 。 期待您的更新。 此致, Steven Cheng Microsoft MSDN在线支持主管 ==== ============================================== 通过电子邮件收到我的帖子通知?请参阅 http:/ /msdn.microsoft/subscripti...ult.aspx#notif ications。 注意:MSDN托管新闻组支持提供适用于非紧急问题 其中,社区或Microsoft支持工程师在1 工作日内做出初步回复回复 可以接受。请注意,每个跟进回复可能需要大约 2个工作日 因为与您合作的支持专业人员可能需要进一步调查 来达到最优惠的分辨率。此产品不适合需要 紧急,实时或基于电话的互动或复杂项目分析的情况 和转储分析 问题。这种性质的问题最好通过专门工作来支付 Microsoft支持 工程师通过联系Microsoft客户支持服务(CSS) http://msdn.microsoft/subscripti ... t / default.aspx 。 ============================ ====================== 此帖子按原样提供。没有保证,也没有授予任何权利。 Hello Ben, Welcome to the ASP.NET newsgroup. From your description, you have hosted multiple ASP.NET 2.0 and 1.1 web applications under a IIS website. And those ASP.NET 2.0 web applications are under the same parent directory in the IIS virtual path. currently you''re trying to store some shared configuration info in the web.config file within the parent directory of those ASP.NET 2.0 applications so that they can automatically inherits the setting from them, correct? Based on my understanding, such inheritance is naturally supported in ASP.NET application(both 1.1 and 2.0). And the following MSDN document describe the general rules of such configuration inheritance: #ASP.NET Configuration File Hierarchy and Inheritance msdn2.microsoft/en-us/library/ms178685.aspx For your scenario, I think the problem may caused by the following things: 1. How are all the directories(from the IIS site root to the sub application) created, through a physical sub directory or a mapped external physical path? e.g. in your case, the complete path is "wwwroot\group\siteX" Then, is the "group" directory a physical sub directory of "wwwroot"(site root)? I''ve performed some local tests, and if the "group" folder is a physical sub directory(not necessarily an application virtual directory), the web.config setting in it will be inherited by any sub ASP.NET applications under it(not matter through physical sub directory or a mapped virtual directory poinetd to an external physical path). 2. What''s the configuration sections are you going to share in the parent web.config file? My local test use the "<connectionStringssection as the one to be inherited and it works well. Are you going to share the same setting or any paricular configuration setting? Anyway, please feel free to let me know if there is anything I''ve missed or if there is any particular concerns in your scenario. Looking forward to your update. Sincerely, Steven Cheng Microsoft MSDN Online Support Lead ================================================== Get notification to my posts through email? Please refer to msdn.microsoft/subscripti...ult.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at msdn.microsoft/subscripti...t/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.

你好Ben, 你好吗?在这个问题上做什么?您是否有任何进展或仍然遇到这个问题的任何困难?如果还有什么我们可以提供的帮助, 请随时告诉我。 此致, Steven Cheng Microsoft MSDN在线支持主管 此帖子按原样提供。没有保证,也没有授予任何权利。 Hello Ben, How are you doing on this issue? Have you got any progress or still meet any difficulties on this issue? If there is anything else we can help, please feel free to let me know. Sincerely, Steven Cheng Microsoft MSDN Online Support Lead This posting is provided "AS IS" with no warranties, and confers no rights.

史蒂文, 感谢您的回复。我没有运气。继承 设置(连接字符串)的唯一方法是它们位于 网站的根目录中。 inetpub \ www.root \web.config - main inetpub \wwwroot\group1 \web.config - shared inetpub \wwwroot \ group1 \ site1 inetpub \ www.root \ group1 \ site2 inetpub \ www.root\group1 \site3 随着上面的文件结构,如果我在主要的配置文件,site1,site2和site3中放置一个连接字符串,请参阅连接字符串。如果我从主配置中删除 连接字符串并将其放在共享的 配置中,则所有站点都不会看到该设置。 我正在做的事应该有效吗?我是这么认为的,但它不是.b $ b不是。 谢谢, Ben Steven Cheng [MSFT]" < st ***** @ online.microsoft写信息 news:qu ************** @ TK2MSFTNGXA01.phx.gbl ... Steven, Thanks for your reply. I haven''t had any luck with this. The only way the settings (connection strings) are inherited is if they are in the root of the site. inetpub\wwwroot\web.config - main inetpub\wwwroot\group1\web.config - shared inetpub\wwwroot\group1\site1 inetpub\wwwroot\group1\site2 inetpub\wwwroot\group1\site3 With the file structure above, if I put a connection string in the main config file, site1, site2 and site3 see the connection string. If I remove the connection string from the main config and place it in the shared config, none of the sites see the setting. Is what I''m doing something that should be working? I thought so, but it isn''t. Thanks, Ben "Steven Cheng[MSFT]" <st*****@online.microsoftwrote in message news:qu**************@TK2MSFTNGXA01.phx.gbl... 你好Ben, 你在这个问题上做得怎么样?您是否有任何进展或仍然遇到这个问题的任何困难?如果还有什么我们可以提供的帮助, 请随时告诉我。 此致, Steven Cheng Microsoft MSDN在线支持主管 此帖子按原样提供。没有保证,也没有赋予 权利。 Hello Ben, How are you doing on this issue? Have you got any progress or still meet any difficulties on this issue? If there is anything else we can help, please feel free to let me know. Sincerely, Steven Cheng Microsoft MSDN Online Support Lead This posting is provided "AS IS" with no warranties, and confers no rights.

更多推荐

继承web.config ASP.NET 2.0

本文发布于:2023-11-02 00:24:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550838.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:config   web   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!