J'ai l'application Web ASP.NET MVC qui utilise Entity Framework et Compact DB - "db.sdf" ou "db.mdf" fichier.Azure 1 heure Web App try - SQL Compact db
Cela fonctionne chez localhost. Mais je souhaite le publier sur Azure en tant qu'application Web d'essai d'une heure.
J'ai eu cette erreur:
The Entity Framework provider type 'System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application.
Que se passe-t-il? J'ai installé les paquets:
EF.SqlServer
EF.SqlServerCompact
System.Data.SqlServerCe
Et le web.config regarde:
<configSections>
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,
EntityFramework, Version=6.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data
Source=|DataDirectory|db.sdf"
providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0"
invariant="System.Data.SqlServerCe.4.0"
description=".NET Framework Data Provider for Microsoft SQL Server Compact"
type="System.Data.SqlServerCe.SqlCeProviderFactory,
System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
"* Mais je souhaite le publier sur Azure en tant qu'application Web d'une heure *" - je ne suis pas sûr de ce que cela signifie. –
Peut-être que vous avez besoin de faire le fichier "Copy To Local" - pour ce faire, ouvrez les références, cliquez sur SqlServerCe.4.0 et dans la fenêtre de propriétés choisissez Copier en local. Cela garantira que le fichier fait partie du package de déploiement. –