我试图在安装了 iis 的 Windows 7 的全新安装上部署一个基本的 MVC 4 应用程序,该应用程序使用 Entity Framework 6(代码优先)和 SQL Compact 4.0(未安装 mvc 4 和 sql compact 4.0)。
我在 db 项目上安装了以下 nuget 包:
- EntityFramework(版本 6.0.0-alpha2)
- EntityFramework.SqlServerCompact(版本 6.0.0-alpha2)
- Microsoft.AspNet.Providers(1.2 版)
- Microsoft.AspNet.Providers.Core(1.2 版)
- Microsoft.SqlServer.Compact(版本 4.0.8876.1)
在 web.config 我得到以下配置:
<connectionStrings>
<add name="[Name]" connectionString="Data Source=|DataDirectory|[FileName].sdf" providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
......................
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</providers>
</entityFramework>
bin 文件夹(sql ce 文件在 amd64 和 x86 文件夹中:
- [amd64]
- [x86]
- Antlr3.Runtime.dll
- DotNetOpenAuth.AspNet.dll
- DotNetOpenAuth.Core.dll
- DotNetOpenAuth.OAuth.Consumer.dll
- DotNetOpenAuth.OAuth.dll
- DotNetOpenAuth.OpenId.dll
- DotNetOpenAuth.OpenId.RelyingParty.dll
- 实体框架.dll
- EntityFramework.SqlServer.dll
- EntityFramework.SqlServer.xml
- EntityFramework.SqlServerCompact.dll
- EntityFramework.SqlServerCompact.xml
- 实体框架.xml
- Microsoft.Web.Infrastructure.dll
- Microsoft.Web.WebPages.OAuth.dll
- Newtonsoft.Json.dll
- ShipMedProto.DB.dll
- ShipMedProto.DB.pdb
- ShipMedProto.Web.dll
- ShipMedProto.Web.pdb
- System.ComponentModel.DataAnnotations.dll
- System.Data.DataSetExtensions.dll
- System.Data.SqlServerCe.dll
- System.Data.SqlServerCe.Entity.dll
- System.Net.Http.Formatting.dll
- System.Web.Helpers.dll
- System.Web.Http.dll
- System.Web.Http.WebHost.dll
- System.Web.Mvc.dll
- System.Web.Optimization.dll
- System.Web.Providers.dll
- System.Web.Razor.dll
- System.Web.WebPages.Deployment.dll
- System.Web.WebPages.dll
- System.Web.WebPages.Razor.dll
- WebActivatorEx.dll
- WebGrease.dll
- WebMatrix.Data.dll
- WebMatrix.WebData.dll
当我部署到干净的机器时,我收到以下错误消息:
找不到请求的 .Net Framework 数据提供程序。它可能没有安装。
在我的开发机器上它工作正常。(我安装了 sql ce)
任何线索我做错了什么?