【发布时间】:2011-10-14 15:31:12
【问题描述】:
我的 Visual Studio 2010 (C#) 应用程序正在运行,我这周一直在尝试使用安装项目部署它,但没有成功。
我首先在 Privately Deploying SQL Server Compact with the ADO.NET Entity Provider 上关注 Steve Lasker 的网络博客。它让我修改了项目的 app.config 文件以包含以下内容:
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.3.5"></remove>
<add name="Microsoft SQL Server Compact Data Provider"
invariant="System.Data.SqlServerCe.3.5"
description=".NET Framework Data Provider for Microsoft SQL Server Compact"
type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
该安装仅在已安装 SQL Server CE 的 PC 上成功运行(例如仅MY PC)。
我仔细查看了这篇文章,发现它写于 2008 年,但是 David V 留下了一条评论链接到 SQL CE Team 的文章 Troubleshooting: Privately deploying the SQL Server Compact 3.5 SP2 ADO.NET Entity Framework provider (System.Data.SqlServerCe.Entity.dll) in the application folder does not work。在他们的文章中,他们说我必须添加“程序集绑定重定向”(错误链接)并在我的 app.config 文件中附加以下信息:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
<bindingRedirect oldVersion="3.5.1.0-3.5.1.50" newVersion="3.5.1.50"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
所以,我这里有一个无法安装的安装程序。
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="LastRun" value=""/>
<add key="UserName" value=""/>
</appSettings>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.3.5"></remove>
<add name="Microsoft SQL Server Compact Data Provider"
invariant="System.Data.SqlServerCe.3.5"
description=".NET Framework Data Provider for Microsoft SQL Server Compact"
type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
<bindingRedirect oldVersion="3.5.1.0-3.5.1.50" newVersion="3.5.1.50"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我的app.config 文件损坏了吗?
我的应用程序仍然运行良好,但安装程序无法安装任何东西。对于更改的临时文件名,安装程序的错误始终为 2727:
调试:错误 2727:目录表中不存在目录条目“_1083472CD2EB47548297E3336FCD9A58”
我该怎么办?
是否有人为私有实例成功部署了 Microsoft SQL CE Server SP2?
【问题讨论】:
标签: c# visual-studio-2010 installation app-config