i have created an outlook addin that uses a sqlite db and the entity framework, the application works 100% when running in debug with visual studio. I have then built a wix installer to install the addin which installs the addin without any problems, my issue is that when i try write to the sqlite db using the installed version i get the following error:
No connection string named 'TaskMonsterDBEntities' could be found in the application config file.
System.InvalidOperationException: No connection string named 'TaskMonsterDBEntities' could be found in the application config file.
at System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at TaskMonsterOutlookAddin.OutlookRibbon.RefreshLocalClientTable(List`1& clients)
at TaskMonsterOutlookAddin.OutlookRibbon.RefreshLocal()
i suspect my connection string in my app config is not correct, could anyone suggest what the problem is or a solution? my app.config looks like this:
="1.0"="utf-8"
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="TaskMonsterDBEntities"
connectionString="metadata=res://*/EFModel.TMModel.csdl|res://*/EFModel.TMModel.ssdl|res://*/EFModel.TMModel.msl;provider=System.Data.SQLite.EF6;provider connection string='data source="C:\Program Files (x86)\Task Monster\TaskMonsterDB"'"
providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>