First, thank you for the link to web.config transformation. I will read it.
Mainly I need two different web.config files because each application (one in the Site and the other in Virtual Directory) should use a different Form for Form Authentication. That is, pages in one application should be authentication by form MyAuthen1.aspx and the other one by MyAuthen2.aspx. I am not sure that web.config transformation would allow that. But I will check.
>If you need different web.config versions then it's worth looking at using web.config transformations :
>
http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/web-config-transformations>
>Especially useful if there are only a few differences (e.g connection strings etc.).. It's preferable to maintaining individual .configs in that you have a 'master' copy - if you change that then any changes will propagate to other versions (unless they've been overwritten)
>
>>UPDATE: Found Solution. Need to convert Virtual Directory into the Application in IIS of Server 2008.
>>
>>
>>Hi,
>>
>>The purpose of the following test is to make two application use separate copies of web.config.
>>
>>I have an ASP.NET (4.0) application running on Server 2008 as a site "MySite". This app has web.config that set Forms authentication. Everything works.
>>
>>I create a test application (in VS 2012). Then on the Server 2008 in the site "MySite" I created a Virtual Directory "MyVDir" where I have one page (test.aspx and bin folder with test.dll). The MyVDir also has web.config which has Authentication set to "None". When I try to Browse the test.aspx in the Virtual Directory I get error:
>>
>>
>>Configuration Error
>>Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific
>>error details below and modify your configuration file appropriately.
>>
>>Parser Error Message: 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.
>>
>>
>>The error points to the line Authentication in the web.config of the Virtual Directory.
>>
>>What am I missing? TIA.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham