Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Virtual Directory Application
Message
De
29/05/2014 11:41:22
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600893
Message ID:
01600906
Vues:
28
>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.

You could do that by adding a key in the web.config to identify the correct form.
Or, better, create a custom configuration and add a constant to the conditional compilation symbols (project properties/build tab)
e.g. enter USEFORM_A as a constant. Then in your code:
#ifdef USEFORM_A
//Load form a
#else
//Load form b
#endif
>
>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform