{"id":1793,"date":"2004-12-17T17:31:08","date_gmt":"2004-12-17T16:31:08","guid":{"rendered":"https:\/\/yvespeneveyre8e29bf869d.wordpress.com\/2004\/12\/17\/hritage-de-configuration-dans-une-application-asp-net-configuration-inheritance-in-an-asp-net-application\/"},"modified":"2004-12-17T17:31:08","modified_gmt":"2004-12-17T16:31:08","slug":"hritage-de-configuration-dans-une-application-asp-net-configuration-inheritance-in-an-asp-net-application","status":"publish","type":"post","link":"https:\/\/www.peneveyre.com\/en\/2004\/12\/17\/hritage-de-configuration-dans-une-application-asp-net-configuration-inheritance-in-an-asp-net-application\/","title":{"rendered":"H??ritage de configuration dans une application asp.net &#8211; Configuration inheritance in an asp.net application"},"content":{"rendered":"<p><P>En se r&#233;f&#233;rant &#224; la <A href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpguide\/html\/cpconconfigurationinheritance.asp\">documentation <\/A>Microsoft &#224; propos de l&#8217;h&#233;ritage de configuration, une illustration pr&#234;te &#224; confusion, et le texte l&#8217;accompagnant ne l&#232;ve pas le doute :<\/P><br \/>\n<P><IMG src=\"http:\/\/www.peneveyre.com\/en\/wp-content\/uploads\/sites\/3\/2023\/02\/folders2.gif\" border=\"0\"><\/P><br \/>\n<P>Pour moi, il s&#8217;agit de r&#233;pertoire. Il se trouve que si ce sont des r&#233;pertoires normaux, les diff&#233;rents fichiers web.config situ&#233;s dans SubDir1 et SubDir2 ne seront pas pris en compte (!!). Pour qu&#8217;ils le soient, il faut que ces r&#233;pertoires soient configur&#233;s comme des applications dans IIS. Premier probl&#232;me r&#233;solu.<\/P><br \/>\n<P>Dans Visual Studio cependant, il faut cr&#233;er une autre application web qui sera h&#233;berg&#233;e dans ces sous-r&#233;pertoires. Je me lance alors dans cette op&#233;ration, cr&#233;e ma web form, g&#233;n&#232;re la dll et lance l&#8217;application. L&#8217;application affiche alors un message d&#8217;erreur de type &#8220;<EM>Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately&#8221;.<\/EM> Plusieurs forums parlent de ce probl&#232;me avec diverses solutions. La solution en fait peut &#234;tre r&#233;sum&#233;e en une phrase : <STRONG>ne jamais cr&#233;er un virtual directory et une application web avec Visual Studio<\/STRONG>. On connait d&#233;j&#224; le probl&#232;me de Visual Studio quand il s&#8217;agit de sortir un projet web de Visual Source Safe et l&#224;, il s&#8217;agit d&#8217;un autre probl&#232;me qui s&#8217;ajoute.<\/P><br \/>\n<P>Pour ajouter une application web dans un sous-r&#233;pertoire d&#8217;une autre application, il faut d&#8217;abord cr&#233;er le r&#233;pertoire dans Windows Explorer, ensuite cr&#233;er le virtual directory et seulement ensuite cr&#233;er le projet d&#8217;application web dans Visual Studio en le faisant pointer vers le bon virtual directory. Second probl&#232;me r&#233;solu, mais, malheureument, tr&#232;s mal document&#233;.<\/P><br \/>\n<P>&nbsp;<\/P><br \/>\n<P><EM>Reading&nbsp;the Microsoft <A href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpguide\/html\/cpconconfigurationinheritance.asp\">documentation <\/A>about configuration inheritance, there is a picture that can be confusing. The documentation itself is not even more clear :<\/EM><\/P><br \/>\n<P><EM><IMG src=\"http:\/\/www.peneveyre.com\/en\/wp-content\/uploads\/sites\/3\/2023\/02\/folders2.gif\" border=\"0\"><\/EM><\/P><br \/>\n<P><EM>Seeing the pictures, that are folders and sub-folders. But, if you put some web.config files in SubDir1 and SubDir2, all setting in these configuration files will not work (!!). To override settings, you must configure the sub-folders as applications in IIS. First problem solved.<\/EM><\/P><br \/>\n<P><EM>So, in Dans Visual Studio, you can create a new web application which will be hosted in&nbsp;one of these sub-folders. I do that then I created a new web form, I built the dll and try to run the application. The application showed me the following message :&#8221;Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately&#8221;. Several forums try to solve this issue with one or more solutions. We can say them in one sentence : <STRONG>never create a virtual directory and a web application with Visual Studio<\/STRONG>. We already know the problem of getting a project from Visual SourceSafe and here it is a new problem.<\/EM><\/P><br \/>\n<P><EM>To add a new web application in a sub-folder of an existing web application, you firstly have to create the sub-folder in the Windows Explorer, then create the virtual directory in IIS and lastly create the web application in Visual Studio in that virtual directory. Second problem solved, but, unfortunately, very badly documented.<\/EM><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>J&#8217;ai r??cemment eu quelques soucis avec l&#8217;h??ritage de configuration dans une application asp.net. Malheureusement, ?? ce sujet, je trouve la documentation de Microsoft un peu lacunaire, ou tout du moins, pas claire. &#8211; I recently had some problems with the configuration inheritance in an asp.net application. Unfortunately, the Microsoft documentation is not clear about this topic.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1793","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/posts\/1793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/comments?post=1793"}],"version-history":[{"count":0,"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/posts\/1793\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/media?parent=1793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/categories?post=1793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.peneveyre.com\/en\/wp-json\/wp\/v2\/tags?post=1793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}