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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:51:22+00:00 2026-06-07T00:51:22+00:00

I have this problem: I want to generate a new source code file from

  • 0

I have this problem:

I want to generate a new source code file from a object information.

I make something like this:

dictParamMapping is a Dictionary<string, Type> where the string is a variable name and Type is the type of that variable.

I get the type to build new code using:

dictParamMapping[pairProcess.Value].Type.Name (or FullName)

When Type is int, string, datatable etc… everything works fine but when it is a dictionary, list or any other like that it returns something like:

System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Double, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Which is not correct to build that new source code. I would like to get something like Dictionary<int, double>

Can any one help me?

  • 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-07T00:51:23+00:00Added an answer on June 7, 2026 at 12:51 am

    You appear to want to get a C#-compatible name from a System.Type. You can do this with the CSharpCodeProvider class.

    var typeReference = new CodeTypeReference(typeof(Dictionary<int, double>));
    
    using (var provider = new CSharpCodeProvider())
        Console.WriteLine(provider.GetTypeOutput(typeReference));
    

    Output:

    System.Collections.Generic.Dictionary<int, double>
    

    Note that this is not guaranteed to always provide you with a valid type-name. In particular, compiler-generated types (such as for closures) will typically have type-names that are invalid in C#.

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

Sidebar

Related Questions

I have created this Fiddle with this code: This is my problem I want
I have this problem since I'm beginning in OOP programming I want to close
I have this problem in my SlashDot Menu. I want to change the picture
I have this programming problem, I'm using C#. I want to check if varA
I have this mysql tables I want to display with jqgrid. The problem appears
I have been stumped all day on this problem. Basically I want to check
I run into this problem. I have a textarea which I only want to
Dear everybody who can help, I have this PHP > MongoDB problem, I want
I Have two problem in this Case : I want to pass a JSON
in a new project, I want to generate an XML file with PHP (I've

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.