I'm currently in a single page application with mvc4, web api, knockout and breeze. Using breeze for calling webapi. I can call my webapi directly. But while I call it from breeze and while its trying to get Metadata, its throwing the following exception. I'm not using entity framework in project, so using DBSet with entity to provide EFContextProvider.
public DbSet<TestModel> TestModels{ get; set; }
readonly EFContextProvider<TestProjectDbContext> tmContextProvider =
new EFContextProvider<TestProjectDbContext>();
[System.Web.Http.HttpGet]
public string Metadata()
{
try
{
return tmContextProvider.Metadata();
}
catch (Exception ex)
{
}
}
System.Configuration.ConfigurationErrorsException
TestProject.Controllers.TestProjectController - Metadata error message is - Failed to find or load the registered .Net Framework Data Provider.
source is -System.Data
stack trace is - at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at System.Data.Entity.Infrastructure.SqlCeConnectionFactory.CreateConnection(String nameOrConnectionString)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.LazyInternalContext.get_CodeFirstModel()
at System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer)
at Breeze.WebApi.EFContextProvider`1.GetCsdlFromDbContext(Object context)
at Breeze.WebApi.EFContextProvider`1.BuildJsonMetadata()
at Breeze.WebApi.ContextProvider.Metadata()
at TestProject.Controllers.TestProjectController.Metadata() in D:\TFS\TFS\MvcApplication3\Controllers\TestProjectController.cs:line 29
There is no problem in my development machine, but while I try to deploy it on another machine, came across this issue.