Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral..

Q:Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies

ANSWER:Generally you need to make sure you have updated any Project references to point to the 4.0 managed DLL which usually located at: C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Desktop (System.Data.SqlServerCe.dll). If your references are located in the application folder, then make sure all the dlls are copied and confirm the versions are the same. If the app.config file existed, check it . This file could redirect assembly references version at run time . Such like: 

<assemblyBinding xmlns="urnchemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845DCD8080CC91" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-9.0.242.0" newVersion="4.0.0.0"/>
            </dependentAssembly>
        </assemblyBinding>

 

没有安装Microsoft SQL Server Compact.  EG:Microsoft SQL Server Compact 4.0 Setup

地址:C:\Program Files\Microsoft SQL Server Compact Edition

或者Compact 版本不对

posted @   po-A  阅读(885)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~

Tushare大数据开放社区-免费提供各类金融数据和区块链数据 , 助力智能投资与创新型投资。

Python, Matlab, R, Web数据抽取学习交流。

点击右上角即可分享
微信分享提示