2015-09-15 56 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%,并且工作进程显示了似乎永远运行的一些请求。我想知道这是否表明线程已死锁 - 也许所有等待加载卫星资源组件?

之前有人看到过这种行为,可以探索一些光线或更多的途径去探索?

回答

相关问题