无法加载SQL Server精简的本机组件 [英] Unable to load the native components of SQL Server Compact

查看:1859
本文介绍了无法加载SQL Server精简的本机组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Win7的X64 SQL Server精简版4.0和运行都为Asp.Net和桌面应用程序。这种电脑还具有安装Visual Studio 2010 SP1。但我的Server 2008 R2中产生以下错误Asp.Net的应用程序,但它可以运行桌面应用程序:

I've installed SQL Server Compact Edition 4.0 on Win7 x64 and it runs both for Asp.Net and Desktop Applications. This PC also have Visual Studio 2010 SP1 installed. But my Server 2008 R2 produces following error for Asp.Net applications, although it can run Desktop Applications:

Unable to load the native components of SQL Server Compact corresponding to the
ADO.NET provider of version 8482. Install the correct version of SQL Server
Compact. Refer to KB article 974247 for more details.

我曾与一个SqlDataSource和的SqlCeConnection都尝试。同样的错误。我的web.config是象下面这样:

I've tried both with a SqlDataSource and SqlCeConnection. Same error. My web.config is like below:

<?xml version="1.0"?>
<configuration>
    <connectionStrings>
       <add name="SQLCE" connectionString="Data Source=|DataDirectory|\a.sdf"
        providerName="System.Data.SqlServerCe.4.0" />
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Data.SqlServerCe, Version=4.0.0.0,
                Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
            </assemblies>
        </compilation>
    </system.web>
</configuration>

也试图复制DLL作为sugested <一个href=\"http://stackoverflow.com/questions/3223359/cant-get-sql-server-compact-3-5-4-to-work-with-asp-net-mvc-2\">here但是没有效果。

推荐答案

终于拿到SQL Server精简版4.0 IIS 7.5下工作。问题是权限问题。当前的应用程序池的身份 IWAM_plesk(默认)没有进入到SQL Server Compact 4.0文件夹:

Finally got SQL Server Compact Edition 4.0 working under IIS 7.5. The problem was permission issue. Current Application Pool's identity IWAM_plesk(default) didn't have access to SQL Server Compact 4.0 folders:

C:\\ Program Files文件\\ Microsoft SQL Server的精简版\\ V4.0

C:\\ Program Files文件(x86)的\\ Microsoft SQL Server的精简版\\ V4.0

我只授予读取和放大器;执行和列出文件夹目录的权限,现在,它就像一个魅力。

I just granted Read & Execute and List Folder Contents permissions and now it works like a charm.

这篇关于无法加载SQL Server精简的本机组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆