I’m trying to get assembly version of an exe in C# with the following code
Assembly asm = Assembly.LoadFrom(address);
return asm.GetName().Version;
it works perfect but if I try to delete the exe after I used this function, it says “Access Denied” since the exe is being used by another process!
is there any Dispose call or something which releases the file handle or any other solution?
This issue was dealt with here
How to unload an assembly from the primary appdomain