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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:56:32+00:00 2026-06-03T14:56:32+00:00

The project has a custom configuration section class with a name MyNamespace.MyConfig. The class

  • 0

The project has a custom configuration section class with a name MyNamespace.MyConfig. The class is stored in a C# library MyNamespace.MyAssembly.dll.

The project has also a console application. The client wants it to be called the same way as the dll, i.e. MyNamespace.MyAssembly.exe.

App.config file has the following definiton:

 <section name="myConfigSection" type="MyNamespace.MyConfig, MyNamespace.MyAssembly"/>

Now the problem is that the application does not find the MyConfig class, because it is looking in the wrong assembly – in the exe file.

The first idea was to be more specific about the name of the assembly, so the ConfigurationManager knows that it should look in the dll and not in the exe:

 <section name="myConfigSection" type="MyNamespace.MyConfig, MyNamespace.MyAssembly.dll"/>

unfortunately this doesn’t help, the application says, it cannot find an assembly with a name MyNamespace.MyAssembly.dll.

The only way to make it work is to rename the application assembly to MyNamespace.MyAssembly.Console, but the client doesn’t agree with this.

How can I tell the ConfigurationManager that it should look for my MyNamespace.MyConfig class in the MyNamespace.MyAssembly.dll and not in the MyNamespace.MyAssembly.exe ?

  • 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-03T14:56:35+00:00Added an answer on June 3, 2026 at 2:56 pm

    Unfortunately, there’s no way to instruct .NET to search for .dll first in this situation. Even with a full name of the assembly like

    <section name="myConfigSection" type="MyNamespace.MyConfig, MyNamespace.MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=...."/>
    

    it will still check the current exe first because they share an identical assembly name.
    I’ll suggest using a different output assembly name for your config project without changing project name.

    enter image description here

    Then use

    <section name="myConfigSection" type="MyNamespace.MyConfig, MyNamespace.MyAssemblyConfig />
    

    in the app.config.

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

Sidebar

Related Questions

I have a Setup Project which uses a System.Configuration.Install.Installer Class forhandling some custom actions.
So right now my project has a few custom dialogs that do things like
I have an ASP.NET project which has already some custom fields in it's web.config
I have created a small flash CS4 project that has a few custom components
We use custom type to represent Identifiers in our project. It has TypeConvertor attached
I've made a .net 2.0 library project, that results in a dll. I've made
I'm working on an asp.net project that uses an in-house developed custom SessionStateProvider class.
I am working on internationalizing a project that has a custom date picker. The
I have an install project which has a custom action that executes a VBScript
The project I'm working on has a custom file format, with a pre-defined structure.

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.