Possible Duplicate:
How do I tell if a win32 application uses the .NET runtime
I have a file name, and I check this file exist in current directory, my problem is I want to know this file( the file is executable) is .Net exe or regular exe.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use the Assembly.LoadFrom method. This will throw an exception if the assembly is not a .NET assembly, or relies on a newer version of the framework. As long as you are using the latest version of the framework, the following sample will only return false when the path is not a .NET assembly.