2015-09-15 55 views
0

我已經繼承了一個asp.net網站,是VB.Net webforms和C#MVC的混合。項目使用相同的密鑰已添加使用resx

近日,在部署到服務器,我們得到一個錯誤:

System.ArgumentException: An item with the same key has already been added. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream) at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture) at System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture)

此錯誤仍然存​​在,直到應用程序復位(通過調整web.config中)。

該網站使用resx文件進行翻譯,如果我們發現異常,它似乎來自第一次使用資源字符串。

我認爲這是Temporary files asp.net resx files, "item with the same key has already been added"的重複,但我沒有足夠的'rep'來評論該帖子。

我的直覺是,它是由競爭條件加載本地資源文件的衛星程序集引起的。我的另一個想法是,這是一個真正的重複,因爲我們在同一臺服務器上的兩個不同的IIS網站上託管相同的代碼(一個用於「分段」,另一個用於生產)。這可能會導致它嘗試從臨時IIS文件加載資源程序集的副本卷影副本。爲了證明這一點,我刪除了臨時文件,錯誤消失了,但這可能只是重新編譯應用程序的結果。

只有在部署到服務器之後(使用MSDeploy),我們纔會在開發過程中收到此錯誤。我試過刪除部署中的臨時IIS文件,但這沒有任何區別。

這可能是一個單獨的問題或症狀,但我們也看到CPU在部署時達到100%,並且工作進程顯示了似乎永遠運行的一些請求。我想知道這是否表明線程已死鎖 - 也許所有等待加載衛星資源組件?

之前有人看到過這種行爲,可以探索一些光線或更多的途徑去探索?

回答

相關問題