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 8588773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:53:10+00:00 2026-06-11T22:53:10+00:00

I have a vb.net windows forms application in which I’m using inheritance for the

  • 0

I have a vb.net windows forms application in which I’m using inheritance for the windows forms. I have a base form that provides some of the basic layout and methods that will be used with all inheriting forms. This includes the initialization of an entity framework context in the base form constructor.

Dim dataContext As New CCEntities()

The child form can then make use of this context. The application compiles and runs without error, but when I try to view the child form in the designer, an error is displayed stating, “The specified named connection is either not found in the configuration, not intended to be used with the EntitlyClient provider, or not valid.” If I move that initialization line into the child form constructor, the designer displays without error.

In an attempt to troubleshoot this, I specified the connection string at initialization time in the base form constructor as:

Dim dataContext As New CCEntities(System.Configuration.ConfigurationManager.ConnectionStrings.Item("CCEntities").ConnectionString)

After adding that reference to the connection string, the child form now displays “Object reference not set to an instance of an object.“

However, if I hard-code the entity connection string into that initialization line, the designer works fine.

It appears that the base form is unable to access the app.config file. How can I get the base form to properly access the app.config file and make the designer work appropriately?

  • 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-11T22:53:12+00:00Added an answer on June 11, 2026 at 10:53 pm

    What you will need to do is prevent the code from running when you are in “Design time”.

    if(System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
    {
         //do connection stuff here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using c# .net , windows form application. I have a XML file which
I have a Windows Forms application built using the .NET 3.5 Framework which self
I have a .NET 2.0 targeted C# windows forms application that is running fine
I have a windows forms application in .NET 3.5. There's one form with 20
I have a three-tier Windows Forms DB application in VB.NET. I'm using VS 2005.
I have a .NET application that contains a checkbox (System.Windows.Forms.Checkbox). This component (WindowsForms10.BUTTON.app.0.378734a1) is
we have a .net windows forms application and for years we have been using
I have written a Windows Forms application in C#, .NET framework 2.0, that uses
I have a .NET windows forms application compiled as x86 – it needs to
I have written a small .net Windows Forms application. And now I decided to

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.