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?