Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I know the current running exe framework version.

Thanks,
-RG
Posted

1 solution

For an assembly, you can check its ImageRuntimeVersion:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.imageruntimeversion%28v=vs.110%29.aspx[^].

By "current running" you may mean different assemblies. It could be the assembly which called the currently executing method, the assembly executing at the moment, or it could be the entry-point assembly; in general case, those assemblies are different:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getcallingassembly(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getentryassembly(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getassembly(v=vs.110).aspx[^].

—SA
 
Share this answer
 
v3
Comments
Ramug10 6-Mar-14 2:02am    
Thanks for your valuable time.

my problem not resolved. What I want is I have one "xxxxx.exe" currently this exe is running in my machine windows services somebody installed it, I need to know the framework version of it.
Sergey Alexandrovich Kryukov 6-Mar-14 2:06am    
Only because you did not formulate all you had to to. Isn't it obvious what else to do. Load this EXE using Assembly.LoadFrom, obtain instance of the assembly (it may actually appear to be not a .NET assembly), and do with that variable what I described.
Doesn't it finally resolve your problem?
—SA
Ramug10 6-Mar-14 2:29am    
Assembly.LoadFrom() is working
thanks :).
Sergey Alexandrovich Kryukov 6-Mar-14 8:26am    
Sure. Will you accept the answer formally (green "Accept" button)?
—SA
Ramug10 6-Mar-14 8:29am    
yaa sure..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900