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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:34:03+00:00 2026-06-12T22:34:03+00:00

I am using NRefactory to attempt to parse all compile files listed in in

  • 0

I am using NRefactory to attempt to parse all compile files listed in in a .csproj file, and want to be able to resolve all types in a project.

I can’t resolve all types though without adding in the assembly references that the .csproj also contains, which is what I am struggling with.

Excerpt from .csproj:

<ItemGroup>
    <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
    <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
    <Reference Include="mscorlib" />
    <Reference Include="System" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core" />
</ItemGroup>

As can be seen the XNA references give a fullname, so I can easily get their assembly using Type.GetType("fullname").Assembly. But passing in System or mscorlib without the publickey just returns null.

How am I able to get the full type name of System just from the word System and the other information present in a .csproj file?

  • 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-12T22:34:06+00:00Added an answer on June 12, 2026 at 10:34 pm

    Which copy of System.dll do you actually want to load? One that is usable at runtime? Or the one used by the C# compiler?

    If the project targets .NET 4.0, the C# compiler uses a different reference assembly than for projects targeting .NET 4.5. However, at runtime, both use the same assembly (as the .NET 4.5 installation overwrites .NET 4.0).

    To get the same version as used by the C# compiler, the best solution is to ask MSBuild (via Microsoft.Build.dll) to resolve the assembly reference. The sample application on the NRefactory CodeProject article uses this approach, feel free to copy the code from there.

    Getting the correct runtime assembly is impossible in general, as applications can re-configure how assemblies are loaded (app.config or AppDomain.AssemblyResolve event handlers). However a good approximation could be to use MSBuild for determining the full assembly name, and then pass that into Assembly.Load() to let .NET take care of the runtime loading logic.

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

Sidebar

Related Questions

Using the Redis info command, I am able to get all the stats of
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Yii, I want to delete all the rows that are not from today.
Using JNotify in project and it fulfill my all requirements, but some times it
Using a populated Table Type as the source for a TSQL-Merge. I want to
Heys all, I've tried to use NRefactory(Vb) https://github.com/icsharpcode/NRefactory/ but it didn't come with mono.cecil.dll
using a binary search tree I need to add to a vector all int
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
I am using woodstox to implement a StAX parser for XML files. Assume that
Using Java,I have to fetch multiple sets of values from an XML file to

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.