The Structure of the project :
There is a modules folder which I need to add the database and make the repository just there, Other modules and assemblies could use that. New : Changed it to previous proved state of placing the config file in the root application, still there are errors. This post is edited completely.
The Database Location :
location : ....\db\db.sdf (2 levels upper from the sell's app.config)
The App.Config file
location : modules\ModuleX\ (Formerly)
New Location : Shell\ (Main Project)
New Version :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="MyRecordzContext" connectionString="metadata=res://*...
</connectionStrings>
</configuration>
2 Cases of suspect : providerName="System.Data.EntityClient"
LocalDbConnectionFactory
Error Info :
Error Line : TblMyRecord MyRecord = context.MyRecords.First(w => w.MyRecord == stMyRecord);
Error : No connection string named 'MyRecordzContext' could be found in the application config file.
Goal : How to change the connectionstring , my app.config to make the application work as expected
Here EF 5.0, SQL CE , Prism, WPF, MVVM, C# were used
Error :
Error : The type initializer for 'System.Windows.Application' threw an exception.
Appears as the application runs.
The error seems to be before any build.
Stack Trace :
PresentationFramework.dll!System.Windows.Application.Application()
Xz.Shell.exe!Xz.Shell.App.App()
Xz.Shell.exe!Xz.Shell.App.Main()
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args)
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()
[Native to Managed Transition]