Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:05:33+00:00 2026-06-12T23:05:33+00:00

The Structure of the project : There is a modules folder which I need

  • 0

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]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:05:34+00:00Added an answer on June 12, 2026 at 11:05 pm

    Here’s my hunch: ModuleX is the DAL project, which is referenced from another project (probably a Web, Windows Forms or Console application) that we’ll call the Startup Project.

    If this is the case, then the App.Config file in the DAL project is not used.

    There are 2 solutions:

    1. You could specify the connection string in the Startup Project for it to be taken into account. This means that you need to add the <connectionStrings>...</connectionString> tag in:

      • web.config, if the Startup Project is a Web Application
      • app.config, otherwise (e.g. WPF, Console).
    2. Alternatively, you could define this connect string in the machine.config file and that will make it available for any .NET application running on that particular machine.

    The connection string that’s in the DAL project is not used at runtime. I think it’s only used by the EF designer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Zend project where there is a need to make it
Imagine the following folder structure: project src code.c makefile bin How can I compile
I have the following folder structure /project /scrape item.py /spiders myscraper.py inside the file
i'm setting up a new multi module project structure. for now there is an
There is a multi-module Maven-3 project, where one of sub-modules is used as <dependency>
Let's say there's the following directory structure: projects | +--lib1 | | | +-CMakeFiles.txt
Let's say there's following directory structure: root | +--projects | | | +-test |
I have a python project with this directory structure and these files: /home/project_root |---__init__.py
Ok, so I'm trying to finish our simple project for Data Strcutures but there
I have the following directory structure: project/ .git/ ... app/ ... config/ initializers/ braintree.rb

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.