Is there anyway I can find out if my .NET process is running as 32bit process or 64bit process?
            Asked
            
        
        
            Active
            
        
            Viewed 220 times
        
    1
            
            
        - 
                    1Ok, 2565 more points to go, before I can mark that as a duplicate! – Patrick D'Souza Apr 16 '13 at 16:09
3 Answers
5
            
            
        You probably want Environment.Is64BitProcess if you're using .NET 4.0 or later. Otherwise, check IntPtr.Size, as suggested in the other answers.
 
    
    
        Jim Mischel
        
- 131,090
- 20
- 188
- 351
- 
                    Thanks for pointing to new API, this should be a preferable way – illegal-immigrant Apr 16 '13 at 16:10
- 
                    
- 
                    
3
            
            
        if (IntPtr.Size == 4)
    // 32-bit
else if (IntPtr.Size == 8)
    // 64-bit
However, as pointed by @Jim Mischel, on .NET 4 and above, you should use
 
    
    
        Community
        
- 1
- 1
 
    
    
        illegal-immigrant
        
- 8,089
- 9
- 51
- 84
1
            
            
        Use IntPtr.Size property to find out process bitness.
if(IntPtr.Size == 4)
 // 32 bit process
else
 // 64bit process