Click here to Skip to main content
15,120,682 members
Articles / Programming Languages / C#
Posted 14 Apr 2014

Tagged as


4 bookmarked

How to Determine if a .NET Assembly was Built for x86 or x64?

Rate me:
Please Sign up or sign in to vote.
3.00/5 (5 votes)
14 Apr 2014CPOL
An application to read assembly name information reflection


This post demonstrates how to read .NET assembly name metadata.


Originally, I require to detect whether the target platform for any .NET assembly is built? After digging, I end up with creating a small Winform application which can display some Assembly name attributes.

Using the Code

This code can be utilized by firstly calling the GetAssemblyName method in AssemblyName class in System.Reflection namespace (as shown below) and then fetching the different attributes of the assembly to be analyzed.

Read assembly metadata using reflection (System.Reflection):

var assemblyInfo = AssemblyName.GetAssemblyName(textBoxAssemblyFilePath.Text); 
var assemblyName = assemblyInfo.Name 
var assemblyVersion = assemblyInfo.Version 
//similarly to find process architecture  
var assemblyArchitecture = assemblyName.ProcessorArchitecture; 

Using the Sample Application

To find the process architecture of the .NET Assembly, just download the sample application with this post and execute.

Select the assembly to analyse and click on 'Read Assembly Metadata'.

The description text box will show the metadata for which I have programmed. If required, you can do some more research to read other metadata associated with the assembly like - Culture Info, Signing information, private and public key information, etc. (See the screenshot below.)

Image 1

Reference Link


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


About the Author

No Biography provided

Comments and Discussions

QuestionPost updated Pin
Malay Kumar Pandey19-Apr-14 4:23
MemberMalay Kumar Pandey19-Apr-14 4:23 
GeneralWhat about using Corflags.exe? Pin
Mukesh 979136015-Apr-14 19:58
MemberMukesh 979136015-Apr-14 19:58 
GeneralRe: What about using Corflags.exe? Pin
Andreas Gieriet19-Apr-14 22:40
professionalAndreas Gieriet19-Apr-14 22:40 
GeneralRe: What about using Corflags.exe? Pin
Malay Kumar Pandey20-Apr-14 2:54
MemberMalay Kumar Pandey20-Apr-14 2:54 
GeneralRe: What about using Corflags.exe? Pin
Andreas Gieriet20-Apr-14 3:15
professionalAndreas Gieriet20-Apr-14 3:15 
GeneralMy vote of 1 Pin
Jason Curl15-Apr-14 11:11
professionalJason Curl15-Apr-14 11:11 
GeneralMy vote of 1 Pin
Member 1068509015-Apr-14 6:34
MemberMember 1068509015-Apr-14 6:34 
Underexplained and not going straight to the point as title describes it
GeneralMy vote of 1 Pin
Daniele Rota Nodari14-Apr-14 12:21
MemberDaniele Rota Nodari14-Apr-14 12:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.