无法加载 dll,尽管它位于 bin 和 gac 中

发布于 2024-10-02 20:03:14 字数 560 浏览 0 评论 0原文

在我们的网站项目中,我们需要引用程序集 System.Data.DataSetExtensions,4.0.0.0。因此,我们在 webconfig 中添加了对它的引用,但在构建时出现以下错误:

错误 CS0012:类型“System.Data.TypedTableBase`1”是在未引用的程序集中定义的。您必须添加对程序集“System.Data.DataSetExtensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”的引用。

为了以防万一,我们在网站的 bin 文件夹中添加了 dll 版本 4.0.0.0。

最初在gac中只有3.5.0.0版本的这个dll,但我们通过gacutil.exe安装了4.0.0.0版本。现在,当我们检查“gacutil.exe /l”时,正确的程序集版本(4.0.0.0)似乎已加载到 gac 中,但我们在 Windows 资源管理器的 windows/Assembly 文件夹中看不到它(只有版本 3.5.0)。 0.0)。我们仍然遇到同样的错误。

有人对如何解决这个问题有任何建议吗?

谢谢

In our web site project we need to reference the assembly System.Data.DataSetExtensions, 4.0.0.0. So we added a reference to it in the webconfig, but we are getting the following error on build:

error CS0012: The type 'System.Data.TypedTableBase`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

We added the dll version 4.0.0.0 in the bin folder of the site just in case.

At first in gac there was only version 3.5.0.0 of this dll, but we installed the 4.0.0.0 version via gacutil.exe. Now when we check with "gacutil.exe /l" the correct assembly version (4.0.0.0) appears to be loaded in gac, but we can not see it in the windows explorer in windows/assembly folder (there is only version 3.5.0.0). And we are still getting the same error.

Does anyone have any suggestions how to solve this ?

Thanks

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

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

发布评论

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

评论(3

狼亦尘 2024-10-09 20:03:14

您的 Web 项目是否设置为使用#4 .NET Framework?

Is your web project set to use the #4 .NET Framework?

生生不灭 2024-10-09 20:03:14

这可能是一个愚蠢的问题,但是您是否将对 System.Data.DataSetExtensions 的引用添加到您网站的项目引用中?
如果没有右键单击网站项目,请从上下文菜单中选择属性,然后在项目属性页面上选择引用选项卡。现在单击“添加引用”,您应该能够从那里找出答案。

This may be a silly question but, have you added a reference to the System.Data.DataSetExtensions to you web site's project references?
If not right-click on the website project, select properties from the context menu and then on the project properties page select the references tab. Now click add reference and you should be able to figure it out from there.

萧瑟寒风 2024-10-09 20:03:14

web.config 中,设置 targetFramework="4.0"

In your web.config,set targetFramework="4.0".

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