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

  • Home
  • SEARCH
  • 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 7017809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:57:46+00:00 2026-05-27T22:57:46+00:00

I have .NET assembly with some classes marked as ComVisible This assembly is registered

  • 0
  • I have .NET assembly with some classes marked as ComVisible
  • This assembly is registered with regasm /codebase "assembly_path"
  • I have app.config name (actually – MyAssemblyName.dll.config) which are in assembly’s folder
  • I access to appSettings in my assembly through ConfigurationManager.AppSettings["SettingName"]
  • I have VBScript file which creates my COM object through CreateObject("...")
  • When object is created (from VBScript), ConfigurationManager.AppSettings["SettingName"] returns null. It looks like assembly doesn’t see config file.

What should I to do to make it workable?

  • 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-05-27T22:57:46+00:00Added an answer on May 27, 2026 at 10:57 pm

    One possible way, as Komyg said, is to read config file directly, instead of using ConfigurationManager’s embedded behavior. For those, who will have the same problem: instead of

    ConfigurationManager.AppSettings["SettingName"]
    

    you can use:

    var _setting = ConfigurationManager.AppSettings["SettingName"];
    // If we didn't find setting, try to load it from current dll's config file
    if (string.IsNullOrEmpty(_setting))
    {
        var filename = Assembly.GetExecutingAssembly().Location;
        var configuration = ConfigurationManager.OpenExeConfiguration(filename);
        if (configuration != null)
            _setting = configuration.AppSettings.Settings["SettingName"].Value;
    }
    

    This way you will always use read settings from file YourAssemblyName.dll.config which lays in your assembly’s folder. It will allow you to use also another features for app.config (like appSetting‘s file attribute), which will no be available if you will use XPath or something like this.

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

Sidebar

Related Questions

I have a .NET assembly that contains classes to be registered as ServicedComponent through
I have .NET assembly with ComVisible class. Some days ago (I can find that
I have a COM-Callable Wrapper on a .NET assembly. Some of the methods use
I have some ASP.NET Master Pages located in one assembly. I need to use
I have a .NET assembly that has tens of classes and methods which are
I have a windows service that reads from app.config. I want some settings to
I have a .net assembly that has a COM+ ServicedCopmonent in it and at
I have a .net assembly that contains data access code (a bunch of Typed
I have a .NET assembly(3.5 framework) and it basically has a set of custom
I have a .NET assembly DLL that is created on-the-fly from pre-compiled code in

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.