|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
appdomain configuration file errorError = "The configuration system can only be set once. Configuration system is already set" Exception Details: System.InvalidOperationException: The configuration system can only be set once. Configuration system is already set .... System.Web.Configuration.HttpConfigurationSystemBase.EnsureInit() System.Web.HttpRuntime.InitConfiguration(HttpContext context) System.Web.HttpRuntime.FirstRequestInit(HttpContext context) .... I am not on IIS. I am hosting ASP dotnet, in a dotnet console applicaiton. The console app has its own default app domain. When i create as ApplicationHost.CreateApplicationHost(Type.GetType("url.ASPNetHost"), "/",Directory.GetCurrentDirectory()); it worx fine. but when i create myself an appdomain //due to some reason regarding [web]application base directory ....loDomain = AppDomain.CreateDomain(domainId, null, setup);... as mentioned in here (reference) http://radio.weblogs.com/0105476/stories/2002/07/12/executingAspxPage... in my code: msh = ASPNetHost.CreateApplicationHost(Type.GetType("url.ASPNetHost"), "/",Directory.GetCurrentDirectory()+"\\web",Directory.GetCurrentDirectory()); and when i do msh.ProcessRequest(file_name, query,tw); Then this error comes when i use my own appdomain creation. I think this is some one console exe with its domian create another appdomain with its (need to be separately own) configuraiton file (which is there or not there does gives problem) (i do AppDomainSetup setup = new AppDomainSetup(); | setup.ConfigurationFile = "web.config"; BUT IT gives same problem) I hope you guys understand. Thanks in advance Awaiting replies. regards, --- hB Hi, hB.
Maybe it would help to review these links : Application Domain FAQ : http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx There's also good info here : http://www.andymcm.com/dotnetfaq.htm Finally, there's example code at : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemappdomainsetupclassconfigurationfiletopic.asp Juan T. Llibre ASP.NET MVP http://asp.net.do/foros/ Foros de ASP.NET en Español Ven, y hablemos de ASP.NET... ====================== "hB" <habib.ah***@gmail.com> wrote in message Error = "The configuration system can only be set once. Configurationnews:1121590649.929953.229900@f14g2000cwb.googlegroups.com... Hi. system is already set" Exception Details: System.InvalidOperationException: The configuration system can only be set once. Configuration system is already set .... System.Web.Configuration.HttpConfigurationSystemBase.EnsureInit() System.Web.HttpRuntime.InitConfiguration(HttpContext context) System.Web.HttpRuntime.FirstRequestInit(HttpContext context) .... I am not on IIS. I am hosting ASP dotnet, in a dotnet console applicaiton. The console app has its own default app domain. When i create as ApplicationHost.CreateApplicationHost(Type.GetType("url.ASPNetHost"), "/",Directory.GetCurrentDirectory()); it worx fine. but when i create myself an appdomain //due to some reason regarding [web]application base directory ....loDomain = AppDomain.CreateDomain(domainId, null, setup);... as mentioned in here (reference) http://radio.weblogs.com/0105476/stories/2002/07/12/executingAspxPage... in my code: msh = ASPNetHost.CreateApplicationHost(Type.GetType("url.ASPNetHost"), "/",Directory.GetCurrentDirectory()+"\\web",Directory.GetCurrentDirectory()); and when i do msh.ProcessRequest(file_name, query,tw); Then this error comes when i use my own appdomain creation. I think this is some one console exe with its domian create another appdomain with its (need to be separately own) configuraiton file (which is there or not there does gives problem) (i do AppDomainSetup setup = new AppDomainSetup(); | setup.ConfigurationFile = "web.config"; BUT IT gives same problem) I hope you guys understand. Thanks in advance Awaiting replies. regards, --- hB Its not just a simple appdomain configuration problem.
I am doing it this way, may some errors in it. Code fragment: -------------------------------------------------------------------------- string aspDir = HttpRuntime.AspInstallDirectory; string domainId = "ASPHOST_" + DateTime.Now.ToString().GetHashCode().ToString("x"); string appName = (virtualDir + physicalDir).GetHashCode().ToString("x"); AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationName = appName; setup.ConfigurationFile = "app.config"; if (ApplicationBase != null && ApplicationBase != "") setup.ApplicationBase = ApplicationBase; AppDomain loDomain = AppDomain.CreateDomain(domainId, null, setup); loDomain.SetData(".appDomain", "*"); loDomain.SetData(".appPath", physicalDir); loDomain.SetData(".appVPath", virtualDir); loDomain.SetData(".domainId", domainId); loDomain.SetData(".hostingVirtualPath", virtualDir); loDomain.SetData(".hostingInstallDir", aspDir); System.Runtime.Remoting.ObjectHandle oh = loDomain.CreateInstance(hostType.Module.Assembly.FullName, hostType.FullName); ASPNetHost loHost = (ASPNetHost) oh.Unwrap(); loHost.cVirtualPath = virtualDir; loHost.cPhysicalDirectory = physicalDir; loHost.oAppDomain = loDomain; return loHost; -------------------------------------------------------------------------- when quering from my internet client (browser) as http://localhost/ i get this error Server Error in '/' Application. -------------------------------------------------------------------------------- The configuration system can only be set once. Configuration system is already set. Exception Details: System.InvalidOperationException: The configuration system can only be set once. Configuration system is already set. Stack Trace: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- [InvalidOperationException: The configuration system can only be set once. Configuration system is already set] System.Configuration.ConfigurationSettings.SetConfigurationSystem(IConfigurationSystem configSystem) [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) +0 System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) System.Web.Configuration.HttpConfigurationSystemBase.EnsureInit() System.Web.HttpRuntime.InitConfiguration(HttpContext context) System.Web.HttpRuntime.FirstRequestInit(HttpContext context) [HttpException (0x80004005): ASP.NET Initialization Error] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Main Application Thread (MT in a console based app with TcpListener) MT -> creates appdomain. (for asp.net) The class in appdomain.doSoProcessRequest() //proxy call. and then this error comes upon first call to it by proxy call cross appdomain. Thanks.
Other interesting topics
Hide IE ToolBar, AddressBar, StatisBar, etc.
Nothing happens when I click a button Instantiate objects InProc vs StateServer problem connecting to my database behind a firewall Windows Encrypted File System, ASP.NET and IIS [asp.net 2.0] using aspnet tables inside own database Session variables are lost Http Modules Newbie: How to upload and save images using ASP.NET web forms (C#) |
|||||||||||||||||||||||