[RESOLVED] Determine an external EXE/DLL target .NET version
Is there any way (via code or otherwise) that you can tell what version of the .NET framework a particular EXE or DLL is targetting? I know the long way round would be to try and run it on a machine with just .NET 1.1 on, then if that doesnt work try it on a machine with 2.0 on, etc etc but just wondering if there is an easier way :)
Cheers
Chris
Re: Determine an external EXE/DLL target .NET version
Code:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.imageruntimeversion.aspx
That any help?
Re: Determine an external EXE/DLL target .NET version
You can get it with Reflection
vb Code:
Imports System.Reflection
Namespace Reflection
Public Class Peeker
Public Function GetTargetFramework(ByVal Path As String) As String
Dim asm As Assembly = Assembly.LoadFile(Path)
Return asm.ImageRuntimeVersion
End Function
End Class
End Namespace
Re: Determine an external EXE/DLL target .NET version
Ah I see, thanks both of you :)