这可能不是MVC特有的,它可能适用于ASP.NET WebForms,但到目前为止我们已经在MVC2上体验过它.
每当我们使用MSDeploy启动远程部署时,我们会在新部署之前获得请求的简短(5-6秒)"服务器错误"页面.这是错误文本:
'/'应用程序中的服务器错误.
无法加载文件或程序集"Some.Assembly"或其依赖项之一.该进程无法访问该文件,因为该文件正由另一个进程使用.(HRESULT异常:0x80070020)
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:System.IO.FileLoadException:无法加载文件或程序集"Some.Assembly"或其依赖项之一.该进程无法访问该文件,因为该文件正由另一个进程使用.(HRESULT异常:0x80070020)
版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.1
以下是错误页面中显示的堆栈跟踪:
[FileLoadException: Could not load file or assembly 'Some.Assembly' 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.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence …Run Code Online (Sandbox Code Playgroud)