所以这一直困扰我一段时间,但有时候在我的Visual Studio 2013 ASP.NET MVC4项目中,我将删除一个未使用的ViewModel类,并在下一个看起来像这样的编译时出错(对于一个名为"的ViewModel")我刚删除的MostRecentMemberListing.cs:
错误9名称空间'MembershipCenter.ViewModels'中不存在类型或命名空间名称'MostRecentMemberListing'(您是否缺少程序集引用?)c:\ Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\3e932790\42b7ff67\App_Web_cvlbfbci.1.cs 29会员中心
如果我双击VS的"错误列表"面板中的错误,它将打开位于此路径中的文件:C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\3e932790\42b7ff67,这是一个系统生成的视图文件(?),其类名为_Page_Views_Home_MostRecentMember_cshtml.
我已经尝试删除奇怪的文件本身,以及它的包含文件夹和ITS包含文件夹,一直到temp文件夹的路径下Temporary ASP.NET Files.但每次我重新编译我的项目时,所有这些文件夹和文件都直接重新创建,我得到相同的编译错误.
我正在编译期间通过<MvcBuildViews>true</MvcBuildViews>项目文件构建我的视图.如果我关闭此设置,我可以构建+运行正常,但当我将其转回时true,构建错误返回.
有没有人遇到此错误?它与IIS有关吗?我正在运行本地IIS,而不是IIS Express.
我即将将一堆项目从.NET 4.0 + MVC 3迁移到.NET 4.5.2 + MVC5.
为了使这更容易,我创建了一个新的空白MVC项目来比较DLL引用和其他一些东西,如web.config.
在后者中,Visual Studio生成以下条目:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
Run Code Online (Sandbox Code Playgroud)
但我不知道这究竟是什么.MVC 3项目不包含这些部分.我的理解是它与Roslyn有关吗?
我已经阅读了同一个问题上发布的许多其他问题,但我仍然不明白原因以及如何防止它发生.
就我而言,这发生在生产服务器上.我得到了其他问题中描述的相同错误,我通过将程序集重新复制到bin目录来解决它.它们甚至不是重新编译的文件,它们与之前的文件相同 - 再次复制,然后它开始工作没有问题.
奇怪的是,我正在使用Web部署项目将我的所有程序集文件重命名为基于文件夹的dll.所以folder.dll和folder.subfolder.dll而不是App_Web_jt8nxllz.dll.但该错误仍然命名原始的App_Web_jt8nxllz.dll文件.
删除C:\WINDOWS\Microsoft.NET\Framework[64]\v...\Temporary ASP.NET Files文件夹的内容是有效的,一切都很好,但有谁知道如何防止这种错误发生?此外,当它在生产服务器上发生时,关闭IIS或重新启动它实际上并不可行.也许自动清理调度程序上的Temp文件夹?
这里真正的问题是什么?有什么特别的东西会导致这种情况发生吗?该网站将毫无问题地嗡嗡作响,然后突然之间,整个文件夹停止工作并产生此错误.
Could not load file or assembly 'App_Web_jt8nxllz, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Exception type 'System.IO.FileNotFoundException' was caught.
Source: App_Web_whv5zsvd
Target Site: Void __BuildControlTree(ASP.artists_controls_artistheader_ascx)
Stack Trace:
at ASP.artists_controls_artistheader_ascx.__BuildControlTree(artists_controls_artistheader_ascx __ctrl)
at ASP.artists_controls_artistheader_ascx.FrameworkInitialize()
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.UserControl.InitializeAsUserControl(Page page)
at ASP._artists_artist_master.__BuildControlctlArtistHeader()
at ASP._artists_artist_master.__BuildControlctlContent(Control __ctrl)
at System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container)
at ASP.master_mysite_master.__BuildControlMainContent()
at ASP.master_mysite_master.__BuildControlform1()
at ASP.master_mysite_master.__BuildControlBody()
at ASP.master_mysite_master.__BuildControlTree(master_mysite_master __ctrl)
at ASP.master_mysite_master.FrameworkInitialize()
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.MasterPage.CreateMaster(TemplateControl …Run Code Online (Sandbox Code Playgroud) 昨天我的项目运行顺利,但今天我遇到了一个错误.以下是详细信息:
无法加载文件或程序集'file:/// C:\ WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx.6cc23264.lmj8uym6.dll'或其中一个依赖项.句柄无效.(来自HRESULT的异常:0x80070006(E_HANDLE))描述:在执行当前Web请求期间发生了未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
例外细节:
System.IO.FileLoadException:无法加载文件或程序集'file:/// C:\ WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx.6cc23264 .lmj8uym6.dll'或其依赖项之一.句柄无效.(HRESULT异常:0x80070006(E_HANDLE))
来源错误:
在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.
堆栈跟踪:
[FileLoadException:无法加载文件或程序集'file:/// C:\ WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx.6cc23264.lmj8uym6. dll'或其依赖项之一.句柄无效.(来自HRESULT的异常:0x80070006(E_HANDLE))] 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,RunCAslmbly locationHint,StackCrawlMark&stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)+39 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,Evidence assemblySecurity,StackCrawlMark&stackMark,Boolean forIntrospection,Boolean suppressSecurityChecks)+132 System.Reflection.Assembly.Load(AssemblyName assemblyRef,Evidence assemblySecurity)+28 System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()+93 System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results)+65 System.Web.Compilation.TemplateControlBuildProvider.CreateBuildResult(CompilerResults results)+36 System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results)+16 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)+8967378 System.Web.Compilation .BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath,Boolean noBuild,Boolean allowCrossApp,Boolean allowBuildInPrecompile,Boolean throwIfNotFound,Boolean ensureIsUpToDate)+320 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context,VirtualPath virtualPath,Boolean noBuild,Boolean allowCrossApp,Boolean allowBuildInPrecompile, Boolean throwIfNotFound,Boolean ensureIsUpToDate)+111 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath,HttpContext context,Boolean allowCrossApp,Boolean throwIfNotFound)+125 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath,Type …