同じ問題に投稿された他の多くの質問を読みましたが、原因とそれを防ぐ方法をまだ理解していません.
私の場合、これは本番サーバーで発生します。他の質問で説明されているのと同じエラーが発生し、アセンブリを bin ディレクトリに再コピーして解決します。それらは再コンパイルされたファイルではなく、以前にそこにあったものと同じです-再びコピーされ、問題なく動作し始めます。
奇妙な部分は、Web 配置プロジェクトを使用して、すべてのアセンブリ ファイルの名前をフォルダー ベースの dll に変更していることです。そのため、App_Web_jt8nxllz.dll の代わりに folder.dll と folder.subfolder.dll を使用します。それでも、エラーはまだ元の App_Web_jt8nxllz.dll ファイルに名前を付けています。
C:\WINDOWS\Microsoft.NET\Framework[64]\v...\Temporary ASP.NET Files
フォルダの内容を削除しても問題ありませんが、このエラーが発生しないようにする方法を知っている人はいますか? また、IIS をシャットダウンしたり再起動したりすることは、運用サーバーで発生している場合、実際にはあまり現実的ではありません。おそらく、スケジューラーの一時フォルダーを自動的に消去しますか?
ここで本当の問題は何ですか?これが起こる原因は特にありますか?サイトはまったく問題なく動作しますが、突然、1 つのフォルダー全体が機能しなくなり、このエラーが発生します。
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 owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
at System.Web.UI.MasterPage.get_Master()
at System.Web.UI.MasterPage.ApplyMasterRecursive(MasterPage master, IList appliedMasterFilePaths)
at System.Web.UI.Page.ApplyMasterPage()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)