gpt4 book ai didi

c# - 无法加载文件或程序集 'Microsoft.SqlServer.Types,版本 = 11.0.0.0

转载 作者:行者123 更新时间:2023-12-04 18:06:08 26 4
gpt4 key购买 nike

我开始处理我的应用程序,我已经有大约一个月没有碰过它了,当我运行该应用程序并尝试保存更改时,我收到以下错误

Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.":"Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"} System.Exception {System.IO.FileNotFoundException}

我不知道为什么突然出现这个错误,因为我上次运行这个应用程序时从未遇到过这个问题,所以我不知道这是从哪里来的。它发生在 Context SaveChanges 事件上,但是当错误出现时,我可以再次点击运行按钮,它会继续运行,就好像什么也没发生一样。在我这样做之后,所有连续的保存尝试都不会显示错误,但如果我重新启动应用程序,它将再次显示。我的应用程序是一个使用 .NET Framework 和 Entity Framework 4 的 Windows 窗体应用程序,数据库是 Sql Server 2005。对可能导致此问题的原因有任何想法吗?

谢谢

最佳答案

我遇到了同样的问题,突然间我的报告没有出现。

所以我查看了您的报告 View 所在项目的 web.config。

将此代码按原样粘贴到程序集绑定(bind)标签中。

  <dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<!-- <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /> -->
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>

关于c# - 无法加载文件或程序集 'Microsoft.SqlServer.Types,版本 = 11.0.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26112206/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com