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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:39:47+00:00 2026-05-16T17:39:47+00:00

For example in a .NET app.config you might get <configuration> <configSections> <section name=MyConfig type=MyAssembly.MyType,

  • 0

For example in a .NET app.config you might get

<configuration>
   <configSections>
      <section name="MyConfig" type="MyAssembly.MyType, MyAssembly, PublicKeyToken=null" />
   </configSections>
   ...
</configuration>

The signature in the type part seems to be standardized in a variety of .NET places but I have no idea how to do this within my own programs. I have used System.Activator in my programs but that feels like I’m duplicating work that .NET already does.

In programming terms how do I do this:

void Main()
{
   object instance = CreateInstance("MyAssembly.MyType, MyAssembly, PublicKeyToken=null");
   Console.WriteLine(instance.GetType().Name);
}

object CreateInstance(string dotNetTypeSignature)
{
   // Code goes here.
}
  • 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-16T17:39:48+00:00Added an answer on May 16, 2026 at 5:39 pm

    You can call the Type.GetType method to get a Type object with the given (assembly-qualified) name.

    You can call the Activator.CreateInstance method to create an instance of a type. (assuming that the type has a public default constructor, or that you know what constructor arguments it takes).

    For example:

    Activator.CreateInstance(Type.GetType(name));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im writing a .net webforms app. It has a number of classes, for example
In the app.config file of a .NET application there is a <runtime> element that
In a .NET Win console application, I would like to access an App.config file
When working in .NET, I can use the web.config or app.config to set up
AFAIK, usual ASP.NET web site/web application switched on into DEBUG mode when web/app-config setting
We have a custom section in my app.config file related to our IoC container
I use WCF with my ASP.NET MVC app, my data service get data from
Rep steps: create example .NET form application put a TextBox on the form wire
I've seen various means of reading (and writing) Excel spreadsheets. For example: In .Net
Anyone have an minimal example of ASP.NET MVC and dotnetcharting.com control lying around? Thanks,

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.