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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:54:29+00:00 2026-06-15T19:54:29+00:00

In the web.config file, we see a lot of strings following this pattern: type=System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,

  • 0

In the web.config file, we see a lot of strings following this pattern:

    type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, 
System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=31BF3856AD364E35"

I want to read this information from the web.config (which I know how to read as a string), and I want to instantiate a type from this string.

Is there some way to do this?

Update

I guess I could just do

Activator.CreateInstance(System.GetType(stringTypeName))

Please confirm?

  • 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-15T19:54:30+00:00Added an answer on June 15, 2026 at 7:54 pm

    There are several overloads of Activator.CreateInstance that enable you to do this. However, you will have to split the string into a type name and assembly name manually.

    Update: Your own take on this is also correct (although the method is Type.GetType()).

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

Sidebar

Related Questions

This is my web.config file contents: <?xml version=1.0?> <configuration> <system.webServer> <httpErrors errorMode=Detailed /> <asp
I have added the following code to my web.config file: <system.diagnostics> <trace autoflush=false indentsize=4
In a production web.config file for a WCF service I see the configuration included
Here is my Web.config file: <?xml version=1.0?> <configuration> <system.web> <customErrors mode=Off /> <compilation debug=true
Here is my Web.config file <membership> <providers> <clear /> <add name=AspNetSqlMembershipProvider type=System.Web.Security.SqlMembershipProvider connectionStringName=ApplicationServices maxInvalidPasswordAttempts=5
Consider a Web.config file containing the following httpHandlers declaration: <httpHandlers> <add verb=* path=* type=MyWebApp.TotalHandlerFactory/>
I want to write some configuration in web.config file, that will make my ASP.Net
I am trying to access system.webServer/defaultDocument in my web.config file but can't seem to
I have a rewrite rule in my web.config file like this: <rule name=Public page
In my web.config file I have two SQL Server connection strings, one for local

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.