SQL Server CE 4 Clickonce部署VS2013
根据MS的说法,SQL Server CE已经过时,但现在我真的无法考虑迁移到SQL Server Express或LocalDB
,因此,在VS 2013上,有一个惊叹号,文字为“无法找到先决条件”引导”。 有解决方法吗? 当我的程序部署时,SQL Server CE需要自动安装。
提前致谢
我遇到了同样的问题。 我的项目的发布部分的VS 2013先决条件列表中不存在SQL Server Compact Edition 4.0。 为了解决同样的问题,我使用了下面的步骤:
product.xml:
<?xml version="1.0" encoding="utf-8"?>
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="System.Data.SqlServerCe.4.0">
<InstallChecks>
<FileCheck Property="IsInstalled"
FileName="System.Data.SqlServerCe.dll" SearchPath="C:Program FilesMicrosoft SQL Server Compact Editionv4.0Desktop" />
</InstallChecks>
<PackageFiles CopyAllPackageFiles="false">
<PackageFile
Name="SSCERuntime_x86-ENU.exe"
HomeSite="sqllocaldb_32" />
<PackageFile
Name="SSCERuntime_x64-ENU.exe"
HomeSite="sqllocaldb_64" />
</PackageFiles>
<Commands Reboot="Defer">
<Command PackageFile="SSCERuntime_x86-ENU.exe" Arguments="">
<InstallConditions>
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired" />
<BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
<BypassIf Property="IsInstalled" Compare="ValueExists" Value="0" />
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success" />
<ExitCode Value="1641" Result="SuccessReboot" />
<ExitCode Value="3010" Result="SuccessReboot" />
<DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
<Command PackageFile="SSCERuntime_x64-ENU.exe" Arguments="" >
<InstallConditions>
<BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
<BypassIf Property="IsInstalled" Compare="ValueExists" Value="0" />
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success" />
<ExitCode Value="1641" Result="SuccessReboot" />
<ExitCode Value="3010" Result="SuccessReboot" />
<DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
</Commands>
</Product>
创建连接创建的文件夹中的文件夹
在en文件夹中创建package.xml文件并将下一个代码复制到此文件中:
package.xml中:
<?xml version="1.0" encoding="utf-8" ?>
<Package
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName"
Culture="Culture">
<!-- Defines a localizable string table for error messages-->
<Strings>
<String Name="DisplayName">SQL Server Compact Edition 4.0</String>
<String Name="Culture">en</String>
<String Name="AdminRequired">Administrator permissions are required to install SQL Server Compact Edition 4.0. Contact your administrator.</String>
<String Name="GeneralFailure">A failure occurred attempting to install SQL Server Compact Edition 4.0.</String>
</Strings>
</Package>
重新启动MS Visual Studio
您可以在先决条件中找到SQL Server Compact Edition 4.0
如果由于某种原因您无法(直接)应用Erik修复程序,那么您可以尝试以下解决方法:
您可以简单地将SQLCE dll文件包含在您的应用程序中,我有几篇关于如何执行此操作的博客文章
链接地址: http://www.djcxy.com/p/96671.html上一篇: SQL Server CE 4 Clickonce deploy VS2013
下一篇: How to connect to LocalDB in Visual Studio Server Explorer?