Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

3,594 views
Skip to first unread message

Lily

unread,
Jul 8, 2014, 4:50:33 PM7/8/14
to el...@googlegroups.com
I have a mvc site configured with Elmah, that works properly. but now I want to configure the web service (a sub folder of MVC site ) in IIS  as an application. now when I run the webservice site , I am getting the following error, I have tried to editing web.config within webservice folder without any luck. is there anyone know how to solve the issue?
 
Thanks!
Lily
 

Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Elmah' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace: 

[FileNotFoundException: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +153
   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +63
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +124
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +76

[ConfigurationErrorsException: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +12775232
   System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +69
   System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +66
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +300
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1262
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +133
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12968244
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12807949

Atif Aziz

unread,
Jul 8, 2014, 5:36:09 PM7/8/14
to el...@googlegroups.com
It might that your web service site is inheriting settings from the parent site & while the parent is configured to use ELMAH, the child site does not have ELMAH binaries in its bin directory. If so, you might want to check out inheritInChildApplications in web.config.

- Atif

--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lily

unread,
Jul 8, 2014, 8:04:45 PM7/8/14
to el...@googlegroups.com
Thanks Atif for your response. I have this configuration <location path="elmah.axd" inheritInChildApplications="false">. it seems no effect on the site behavior.

Lily

Michael Sumerano

unread,
Jul 8, 2014, 9:11:33 PM7/8/14
to el...@googlegroups.com

You configured the folder in IIS as a full application.  It needs a bin folder as it cannot find it past the root of the application, not the site. 

On Jul 8, 2014 8:04 PM, "Lily" <yiy...@gmail.com> wrote:
Thanks Atif for your response. I have this configuration <location path="elmah.axd" inheritInChildApplications="false">. it seems no effect on the site behavior.

Lily

--
Reply all
Reply to author
Forward
0 new messages