G
Guest
Hi,
I have a problem where my ASP.NET application occasionally generates a
MissingFieldException exception. This unexpectedly happened on my development
box, and so I was able to extract some information from the debugger:
The field that is "missing" is called 'logger'. Here's it's description
taken from ildasm.exe:
..field public static class [log4net]log4net.ILog logger
This field is in a class called 'Utility', which is in an assembly called
'Infrastructure'. This Infrastructure's assembly manifest shows that the
log4net assembly is referenced thus:
..assembly extern log4net
{
.publickeytoken = (07 01 22 69 AF 86 3A C7 )
.ver 1:2:9:0
}
The log4net assembly is a strongly named assembly, but it isn't in the GAC.
I have a suspicion that the fact that the assembly is strongly named may be
relevant, because the problem never occurs with our other assemblies.
System.AppDomain.CurrentDomain.GetAssemblies() showed that there were 40
assemblies loaded. The MissingFieldException exception was being generated
because the Infrastructure assembly wasn't loading properly. When I called
GetTypes() on the Infrastructure assembly, a ReflectionTypeLoadException
exception was thrown saying that "One or more of the types in the assembly
unable to load". Here are the exception's details (taken from the Visual
Studio watch window):
- System.AppDomain.CurrentDomain.GetAssemblies()[14].GetTypes() {"One or
more of the types in the assembly unable to
load."} System.Reflection.ReflectionTypeLoadException
+ System.SystemException {"One or more of the types in the assembly unable
to load."} System.SystemException
+ _classes {Length=72} System.Type[]
- _exceptions {Length=4} System.Exception[]
- [0] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
- [1] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
- [2] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
- [3] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
+ LoaderExceptions {Length=4} System.Exception[]
+ Types {Length=72} System.Type[]
As you can see, .NET is failing to load the log4net assembly because of an
"acccess is denied" error. But the file
C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL did
exist, and didn't have any strange security permission settings. In fact, the
assembly had been loaded - it was in the list of assemblies in the current
domain:
- [17] {System.Reflection.Assembly} System.Reflection.Assembly
System.Object {System.Reflection.Assembly} System.Object
_DontTouchThis 206431072 int
- Cache {System.Reflection.Cache.InternalCache} System.Reflection.Cache.InternalCache
System.Object {System.Reflection.Cache.InternalCache} System.Object
Item <cannot view indexed property> System.Object
- m_cache {Length=2} System.Reflection.Cache.InternalCacheItem[]
- [0] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key AssemblyName System.Reflection.Cache.CacheObjType
- Value "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" System.Object
string "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" string
- [1] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key EmptyElement System.Reflection.Cache.CacheObjType
Value <undefined value> System.Object
m_numItems 1 int
MinCacheSize 2 int
CodeBase "file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL" string
EntryPoint <undefined value> System.Reflection.MethodInfo
EscapedCodeBase "file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL" string
+ Evidence {System.Security.Policy.Evidence} System.Security.Policy.Evidence
FullName "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" string
GlobalAssemblyCache false bool
ImageRuntimeVersion "v1.1.4322" string
Location @"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
files\applysource\f27b5c84\cdeddc66\assembly\dl2\c30d5406\00341f6d_f898c501\log4net.dll" string
m_assemblyData <undefined value> System.Reflection.Emit.AssemblyBuilderData
- m_cachedData {System.Reflection.Cache.InternalCache} System.Reflection.Cache.InternalCache
System.Object {System.Reflection.Cache.InternalCache} System.Object
Item <cannot view indexed property> System.Object
- m_cache {Length=2} System.Reflection.Cache.InternalCacheItem[]
- [0] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key AssemblyName System.Reflection.Cache.CacheObjType
- Value "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" System.Object
string "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" string
- [1] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key EmptyElement System.Reflection.Cache.CacheObjType
Value <undefined value> System.Object
m_numItems 1 int
MinCacheSize 2 int
ModuleResolve <undefined value> System.Reflection.ModuleResolveEventHandler
s_localFilePrefix "file:" string
The MissingFieldException happens on a machine that doesn't have Visual
Studio installed, so the problem can't be due to the build process locking
the DLL. In fact, as the problem is intermittent and won't go away until we
force ASP.NET to reload the application (by re-saving the web.config file), I
don't think it's an external system locking the file at all. One minute
ASP.NET can load the assembly fine, the next it just seems to get confused.
Looking through past posts, it appears that a few other people are also
seeing this problem, but no-one seems to have identified the cause yet. I'm
hoping that the "access is denied" exception shown above will help someone
work out what's going on.
- Lee
I have a problem where my ASP.NET application occasionally generates a
MissingFieldException exception. This unexpectedly happened on my development
box, and so I was able to extract some information from the debugger:
The field that is "missing" is called 'logger'. Here's it's description
taken from ildasm.exe:
..field public static class [log4net]log4net.ILog logger
This field is in a class called 'Utility', which is in an assembly called
'Infrastructure'. This Infrastructure's assembly manifest shows that the
log4net assembly is referenced thus:
..assembly extern log4net
{
.publickeytoken = (07 01 22 69 AF 86 3A C7 )
.ver 1:2:9:0
}
The log4net assembly is a strongly named assembly, but it isn't in the GAC.
I have a suspicion that the fact that the assembly is strongly named may be
relevant, because the problem never occurs with our other assemblies.
System.AppDomain.CurrentDomain.GetAssemblies() showed that there were 40
assemblies loaded. The MissingFieldException exception was being generated
because the Infrastructure assembly wasn't loading properly. When I called
GetTypes() on the Infrastructure assembly, a ReflectionTypeLoadException
exception was thrown saying that "One or more of the types in the assembly
unable to load". Here are the exception's details (taken from the Visual
Studio watch window):
- System.AppDomain.CurrentDomain.GetAssemblies()[14].GetTypes() {"One or
more of the types in the assembly unable to
load."} System.Reflection.ReflectionTypeLoadException
+ System.SystemException {"One or more of the types in the assembly unable
to load."} System.SystemException
+ _classes {Length=72} System.Type[]
- _exceptions {Length=4} System.Exception[]
- [0] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
- [1] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
- [2] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
- [3] {"log4net"} System.IO.FileLoadException
- System.IO.IOException {System.IO.FileLoadException} System.IO.IOException
- System.SystemException {"Access is denied:
'log4net'."} System.SystemException
- System.Exception {"Access is denied: 'log4net'." } System.Exception
System.Object {System.IO.FileLoadException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147024891 int
_innerException { } System.Exception
_message "Access is denied: 'log4net'." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147024891 int
InnerException { } System.Exception
Message "Access is denied: 'log4net'." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase
_fileName "log4net" string
_fusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
FileName "log4net" string
FusionLog "=== Pre-bind state information ===\r\nLOG: DisplayName =
log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=07012269af863ac7\n
(Fully-specified)\r\nLOG: Appbase =
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation\r\nLOG:
Initial PrivatePath = bin\r\nCalling assembly : Infrastructure,
Version=0.0.0.44, Culture=neutral, PublicKeyToken=null.\r\n===\n\r\nLOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/applysource/f27b5c84/cdeddc66/log4net.DLL.\r\nLOG: Attempting download
of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary
ASP.NET Files/applysource/f27b5c84/cdeddc66/log4net/log4net.DLL.\r\nLOG:
Attempting download of new URL
file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL.\r\n" string
Message "Access is denied: 'log4net'." string
+ LoaderExceptions {Length=4} System.Exception[]
+ Types {Length=72} System.Type[]
As you can see, .NET is failing to load the log4net assembly because of an
"acccess is denied" error. But the file
C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL did
exist, and didn't have any strange security permission settings. In fact, the
assembly had been loaded - it was in the list of assemblies in the current
domain:
- [17] {System.Reflection.Assembly} System.Reflection.Assembly
System.Object {System.Reflection.Assembly} System.Object
_DontTouchThis 206431072 int
- Cache {System.Reflection.Cache.InternalCache} System.Reflection.Cache.InternalCache
System.Object {System.Reflection.Cache.InternalCache} System.Object
Item <cannot view indexed property> System.Object
- m_cache {Length=2} System.Reflection.Cache.InternalCacheItem[]
- [0] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key AssemblyName System.Reflection.Cache.CacheObjType
- Value "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" System.Object
string "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" string
- [1] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key EmptyElement System.Reflection.Cache.CacheObjType
Value <undefined value> System.Object
m_numItems 1 int
MinCacheSize 2 int
CodeBase "file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL" string
EntryPoint <undefined value> System.Reflection.MethodInfo
EscapedCodeBase "file:///C:/Environments/XXXX/Development/YYYY/Apply/Presentation/bin/log4net.DLL" string
+ Evidence {System.Security.Policy.Evidence} System.Security.Policy.Evidence
FullName "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" string
GlobalAssemblyCache false bool
ImageRuntimeVersion "v1.1.4322" string
Location @"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
files\applysource\f27b5c84\cdeddc66\assembly\dl2\c30d5406\00341f6d_f898c501\log4net.dll" string
m_assemblyData <undefined value> System.Reflection.Emit.AssemblyBuilderData
- m_cachedData {System.Reflection.Cache.InternalCache} System.Reflection.Cache.InternalCache
System.Object {System.Reflection.Cache.InternalCache} System.Object
Item <cannot view indexed property> System.Object
- m_cache {Length=2} System.Reflection.Cache.InternalCacheItem[]
- [0] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key AssemblyName System.Reflection.Cache.CacheObjType
- Value "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" System.Object
string "log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=07012269af863ac7" string
- [1] {System.Reflection.Cache.InternalCacheItem} System.Reflection.Cache.InternalCacheItem
- System.ValueType {System.Reflection.Cache.InternalCacheItem} System.ValueType
System.Object {System.Reflection.Cache.InternalCacheItem} System.Object
Key EmptyElement System.Reflection.Cache.CacheObjType
Value <undefined value> System.Object
m_numItems 1 int
MinCacheSize 2 int
ModuleResolve <undefined value> System.Reflection.ModuleResolveEventHandler
s_localFilePrefix "file:" string
The MissingFieldException happens on a machine that doesn't have Visual
Studio installed, so the problem can't be due to the build process locking
the DLL. In fact, as the problem is intermittent and won't go away until we
force ASP.NET to reload the application (by re-saving the web.config file), I
don't think it's an external system locking the file at all. One minute
ASP.NET can load the assembly fine, the next it just seems to get confused.
Looking through past posts, it appears that a few other people are also
seeing this problem, but no-one seems to have identified the cause yet. I'm
hoping that the "access is denied" exception shown above will help someone
work out what's going on.
- Lee