Re: GAC Alternative
Brought to you by:
wrowe
From: Electronjockey <ele...@ho...> - 2010-02-22 16:30:27
|
This mornings research and experimentation has produced an interesting result. If I place Apache.Web.dll in just the <APACHE_PATH>\bin the following error occurs on Apache startup: > mod_aspdotnet: System.IO.FileNotFoundException: Could not load file or assembly 'Apache.Web, Version=2.2.0.2199, Culture=neutral, PublicKeyToken=9b9b842f49b86351' or one of its dependencies. The system cannot find the file specified. > File name: 'Apache.Web, Version=2.2.0.2199, Culture=neutral, PublicKeyToken=9b9b842f49b86351' > at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) > at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) > at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) > at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) > at System.Reflection.Assembly.Load(String assemblyString) > at System.UnitySerializationHolder.GetRealObject(StreamingContext context) > at System.Web.Hosting.HostingEnvironment.CreateInstance(Type type) > at System.Web.Hosting.ApplicationManager.CreateInstanceInNewWorkerAppDomain(Type type, String appId, VirtualPath virtualPath, String physicalPath) > at System.Web.Hosting.ApplicationHost.CreateApplicationHost(Type hostType, String virtualDir, String physicalDir) > at Apache.Web.HostFactory.ConnectHost(Int32 HostKey) If I place Apahce.Web.dll in the configured appliction's \bin, as expected Apache errors out on startup with the following: > [Mon Feb 22 11:22:52 2010] [error] (-2146304894)Unknown error: mod_aspdotnet: Could not create the .NET interface for the Apache.Web.HostFactory. > [Mon Feb 22 11:22:52 2010] [crit] (-2146304894)Unknown error: mod_aspdotnet: Failed to start Asp.Net Apache.Web host factory > Configuration Failed > > Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Apache.Web, Version=2.2.0.2199, Culture=neutral, PublicKeyToken=9b9b842f49b86351' or one of its dependencies. The system cannot find the file specified. > File name: 'Apache.Web, Version=2.2.0.2199, Culture=neutral, PublicKeyToken=9b9b842f49b86351' > at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) > at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) > at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) > at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) > at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark) > at System.Activator.CreateInstance(String assemblyName, String typeName) > at System.AppDomain.CreateInstance(String assemblyName, String typeName) If I place Apache.Web.dll in both <APACHE_PATH>\bin, and in a configured application's /bin, the application works. So at this point I have a workable, though less than ideal, solution. I'm now going to do some digging into the first error. I have found some information that suggests calls to System.Web.Hosting.ApplicationHost.CreateApplicationHost require the type passed be registered in the GAC. Now I'm just trying to understand why. Once again what I'm trying to do is get ASP.Net working in XAMPP on a USB drive. Assuming, of course, that a supporting .Net framework is installed on the PC I'm plugged into I'll have a portable asp.net web server. -----Original Message----- From: Electronjockey <ele...@ho...> To : mod...@li... Sent: Sun Feb 21 14:19:15 2010 Subject: Re: GAC Alternative I'm back to my "mobilizing" mod_aspdotnet project and came across this note in the README: And Apache.Web.dll must be in the Global Assembly Cache to participate in the system.web framework. Is there any way around this? Any thoughts? |