运行应用程序时出现错误 CS0008

发布于 2025-01-08 10:37:37 字数 410 浏览 0 评论 0原文

我有一个应用程序在数百台客户端计算机上安装并运行良好,除了一台。该客户端运行在 Windows 7 上(尽管它在 Windows 7 上运行完美)并且应用程序安装正常,但是当您运行它时,他会收到以下错误(见下文)。一周前,该应用程序对他来说运行良好,现在才刚刚开始执行此操作。我尝试过全新安装,以及重新安装 .Net 4(这是应用程序使用的)。任何人都知道可能导致此问题的原因是什么?

无法生成临时类(结果=1)。错误CS0008: 从文件读取元数据时出现意外错误 'c:\ Windows \ Microsoft.NET \程序集\ GAC_MSIL \ System.Xml \ v4.0_4.0.0.0_b77a5c561934e089 \ System.XML.dll' --“给定​​的程序集名称或代码库无效”

I have an application that is installed and running fine on hundreds of client computers, except for one. This client is on Windows 7 (even though it runs perfect on Windows 7) and the application installs ok, but when you runs it he gets the following error (see below). The application was running fine for him a week ago, it has just started doing this now. I have tried a clean install, as well as reinstalling .Net 4 (which is what the application uses). Anyone have any ideas what might be causing this?

Unable to generate a temporary class (result=1). error CS0008:
Unexpected error reading metadata from file
'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0_b77a5c561934e089\System.XML.dll'
-- 'The given assembly name or codebase was invalid'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稀香 2025-01-15 10:37:37

很难确定,但它有点像 XmlSerializer。我并不是 100% 支持 4.0 实现,但在当时,它会在临时位置生成 .cs 文件,编译它们,然后使用该代码执行序列化。

将代码部署到强化的 Web 服务器并发现序列化代码失败的情况并不罕见,因为 ASP.NET 有权写入任何临时目录。你能检查一下权限吗?

除此之外,手动删除 System.xml 程序集并从其中一台工作计算机中替换它怎么样?您可能需要使用命令行才能到达那里。

这两种选择都是肯定的选择,但值得一试。

Difficult to say for sure, but it smacks of the XmlSerializer. I'm not 100% on the 4.0 implementation, but back in the day, it would generate .cs files in a temp location, compile them, then use that code to perform serialization.

It was not uncommon to deploy code to a hardened web server and find serialization code would fail, because ASP.NET would have the rights to write to whatever the temp directory was. Can you check permissions?

Other than, how about manually delete the System.xml assembly and replace it from one of the working machines? You might need to use the command line to get there.

Neither options a sure fire bet, but worth a try.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文