Says DLL file is in use and can't be loaded until restart IIS

G

Guest

Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of its
dependencies. The process cannot access the file because it is being used by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of
its dependencies. The process cannot access the file because it is being used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of
its dependencies. The process cannot access the file because it is being used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of
its dependencies. The process cannot access the file because it is being used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of
its dependencies. The process cannot access the file because it is being used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
B

Ben Rush

It sounds to me like some process was still holding onto references to these
modules. Does it happen consistently?

Sysinterals.com has some utilities you can use to find out what processes
are holding onto what libraries. Sounds to me like some ASP.Net process was
just not behaving well...

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


David Thielen said:
Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
G

Guest

Yes it happens consistently but when I use the sysinternals tools it does not
show another app locking it.

And in this case - how would another app have it locked so it can't be read
when I had just copied it to that computer? I was able to overwrite it in the
copy so at that point nothing had it locked. And the next thing I did was try
to bring up the website.

This is very weird.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Ben Rush said:
It sounds to me like some process was still holding onto references to these
modules. Does it happen consistently?

Sysinterals.com has some utilities you can use to find out what processes
are holding onto what libraries. Sounds to me like some ASP.Net process was
just not behaving well...

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


David Thielen said:
Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Juan T. Llibre

Do you, by any chance, have the indexing service turned on ?
The indexing service has been known to cause errors like that one.

You might want to exclude the .Net Framework temp directory, the system temp
directory and the wwwroot and subdirectories from the indexing service's search.

Or, maybe, an antivirus system is interfering ?





David Thielen said:
Yes it happens consistently but when I use the sysinternals tools it does not
show another app locking it.

And in this case - how would another app have it locked so it can't be read
when I had just copied it to that computer? I was able to overwrite it in the
copy so at that point nothing had it locked. And the next thing I did was try
to bring up the website.

This is very weird.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Ben Rush said:
It sounds to me like some process was still holding onto references to these
modules. Does it happen consistently?

Sysinterals.com has some utilities you can use to find out what processes
are holding onto what libraries. Sounds to me like some ASP.Net process was
just not behaving well...

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


David Thielen said:
Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
D

daniel #

have you tried to delete the fields in temporary aspnet folder?

Daniel

David Thielen said:
Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
B

Ben Rush

It is weird, especially since the sysinternals tool isn't showing what is
locking it down. Perhaps something more low-level is holding onto it - an
antivirus software tool, perhaps?


--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


David Thielen said:
Yes it happens consistently but when I use the sysinternals tools it does
not
show another app locking it.

And in this case - how would another app have it locked so it can't be
read
when I had just copied it to that computer? I was able to overwrite it in
the
copy so at that point nothing had it locked. And the next thing I did was
try
to bring up the website.

This is very weird.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Ben Rush said:
It sounds to me like some process was still holding onto references to
these
modules. Does it happen consistently?

Sysinterals.com has some utilities you can use to find out what processes
are holding onto what libraries. Sounds to me like some ASP.Net process
was
just not behaving well...

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


David Thielen said:
Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried
to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being
used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or
one
of
its dependencies. The process cannot access the file because it is
being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly
'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or
one
of
its dependencies. The process cannot access the file because it is
being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName)
+180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
+378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or
one
of
its dependencies. The process cannot access the file because it is
being
used
by another process. (Exception from HRESULT: 0x80070020)]

System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
+612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters)
+456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or
one
of
its dependencies. The process cannot access the file because it is
being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
G

Guest

The indexing service is disabled and no anti-virus. This is a test server so
it's pretty vanilla.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Juan T. Llibre said:
Do you, by any chance, have the indexing service turned on ?
The indexing service has been known to cause errors like that one.

You might want to exclude the .Net Framework temp directory, the system temp
directory and the wwwroot and subdirectories from the indexing service's search.

Or, maybe, an antivirus system is interfering ?





David Thielen said:
Yes it happens consistently but when I use the sysinternals tools it does not
show another app locking it.

And in this case - how would another app have it locked so it can't be read
when I had just copied it to that computer? I was able to overwrite it in the
copy so at that point nothing had it locked. And the next thing I did was try
to bring up the website.

This is very weird.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Ben Rush said:
It sounds to me like some process was still holding onto references to these
modules. Does it happen consistently?

Sysinterals.com has some utilities you can use to find out what processes
are holding onto what libraries. Sounds to me like some ASP.Net process was
just not behaving well...

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
G

Guest

I will try that next time. But I would hope that IIS/ASP does not trip over
something like that.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




daniel # said:
have you tried to delete the fields in temporary aspnet folder?

Daniel

David Thielen said:
Hi;

I copied a new set of files over to my ASP.NET dir (and subdirs) on our
test
server. This replaced every file for the app. When I first then tried to
bring it up, I got the below error.

After I bounced IIS, then it worked fine. log4net.dll is in the Bin
directory. What is going on here - this makes no sense to me.

[FileLoadException: Could not load file or assembly 'log4net' or one of
its
dependencies. The process cannot access the file because it is being used
by
another process. (Exception from HRESULT: 0x80070020)]

[FileLoadException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
+141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +596

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+3487241
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai)
+46

System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +180

System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one
of
its dependencies. The process cannot access the file because it is being
used
by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434943
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
Version:2.0.50727.210

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Hi Dave,

When you copy new content into your ASP.NET site, have you also copy the
Log4net dll and overwrite the original one? I suspect that the problem may
due to the shadow copied log4net assembly(in ASP.NET temporary folder) be
locked. Have you tried putting the log4net assembly into GAC to see whether
you'll suffer the same problem. also, when testing ,you can also change the
<compilation debug="xxx" /> to false so as to make the dynamic compilation
as release condition.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top