Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# gschuager 12/8/2008 3:16 PM
Hi, last week I've set up a new website usign Cuyahoga.
The application runs ok for a couple of hours and then it hangs throwing the following exception when I try to access it:

----------------------------------------------------------------------------------------

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. Access is denied.

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.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. Access is denied.


[FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. Access is denied.]
Cuyahoga.Web.Global..cctor() +0

[TypeInitializationException: The type initializer for 'Cuyahoga.Web.Global' threw an exception.]
Cuyahoga.Web.Global..ctor() +0
ASP.global_asax..ctor() in e:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c02c4286\bf91c1b8\App_global.asax.3oe1m7vo.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1036
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +114
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +197
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance() +27
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context) +3460678
System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context) +125
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +99
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350

----------------------------------------------------------------------------------------


To restart the application, I need to delete the web.config file, try to access the url (which of course gives me another exception), then copy the web.config again and at this point it is back up and working for at least a couple of hours more.

I'd like to know what can I do to debug this issue... it is a problem related to my hosting provider?

Thanks in advance.

Kind regards,

Germán.
# martijnb 12/8/2008 4:13 PM
Could you check if the IIS user (Network Service or ASPNET) has write permissions to the /log directory, or disable logging by commenting out the log4net section in web.config? I suspect a permissions problem when log4net tries to write the log file.
# gschuager 12/9/2008 3:29 AM
I've already commented the log4net section in web.config and the problem persists.

I've noticed another thing: when the exception is thrown, if I just overwrite the log4net.dll file (with the same file) using FTP, the application starts to work (for a couple more hours).

It is very weird... I haven't noticed this behavior using a local IIS installation.

Any hint will be very appreciated.

Regards,
Germán.
# martijnb 12/9/2008 10:08 AM
Very strange. Maybe you have MS Search running in the background that messes things up? It looks like something is touching the log4net dll.
# sonicaab 10/2/2009 10:31 AM
Hi,

I'm also experiencing the same error. Did you manage to resolve the issue?

At the moment I have commented out the log4net section in the web config, and that seems to have stopped the problem.

But this solution isn't ideal.

The website source folder has full user permissions granted to the user the website is running under in IIS.

Does this user need access to any other folders as well?

It might be worth noting that the site is running in a shared network directory.