Jump to content
Tuts 4 You

Queryassemblyinfo - problem solved


CodeExplorer

Recommended Posts

CodeExplorer
Posted (edited)

QueryAssemblyInfo ****s my brain

if I remove the two comment (lines) gacfilepath will have the right path;

if I don't gacfilepath will be null;

Assembly executingasm = Assembly.GetExecutingAssembly();

string currentassemblyname = executingasm.Location;

string asmname = executingasm.GetName().ToString();

//int untilat = asmname.IndexOf(", PublicKeyToken=");

//asmname = asmname.Remove(untilat, asmname.Length-untilat);

string gacfilepath = Fusionhelper.QueryAssemblyInfo(asmname);

Any idea guys?

Edited by CodeRipper
Posted

hmm i think when it tries to resolve the assembly and u cut out PKT before it can't find it .. (prolly checks FullName which includes Token Info ..but not 100% anyomre ;)

CodeExplorer
Posted

Solved! I just removed Culture;

Now works fine

Assembly executingasm = Assembly.GetExecutingAssembly();

string currentassemblyname = executingasm.Location;

AssemblyName asmname = executingasm.GetName();

string builded =

asmname.Name+

", Version="+asmname.Version+

", PublicKeyToken="+BitConverter.ToString(asmname.GetPublicKeyToken()).Replace("-","");

string gacfilepath = Fusionhelper.QueryAssemblyInfo(builded);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...