As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [corflags]

The CorFlags Conversion Tool is part of Miscrosoft's .NET Framework that allows users to view and configure the CorFlags section of an assembly header, which includes information about 32-bit and 64-bit compatibility of the assembly. Use this tag for questions regarding the tool or the CorFlags assembly header secton.

Filter by
Sorted by
Tagged with
0 votes
1 answer
206 views

Target "Any CPU" with "Prefer 32-bit" disabled gets compiled with 32-bit preference anyway

I set my target to "Any CPU" with "Prefer 32-bit" disabled. I wondered why my process is still running as 32-bit on a 64-bit system, so I checked CorFlags. It confirms, that my ...
Rev's user avatar
  • 5,732
0 votes
1 answer
232 views

Debugging of assemblies with CorFlags ILLibrary flag set

I've tried to debug some ASP.NET Core app. Although I've set the COMPLUS_ZapDisable environment variable to 1 and checked 'Suppress JIT optimization on module load' in Visual Studio, the code in ...
alerosmile's user avatar
0 votes
1 answer
783 views

Run corflags automaticly after build

I build a WPF program for the .NET framework. I need to run the following corflags command in order for the program to work correctly. corflags c:/[file location]/[file name].exe /32BITREQ+ Now I do ...
Mark Baijens's user avatar
0 votes
0 answers
185 views

Which VisualStudio-Settings change CorFlags (32BITREQ) [duplicate]

which settings in Visual Studio are changing the CorFlags? Especially: Which settings i have to change to set/unset the 32BITREQ flag of my built .dll-file? I know i can toggle the flaggs with VS ...
ysfaran's user avatar
  • 4,714
4 votes
1 answer
2k views

How to Force an assembly to run as x64 bit which was built against AnyCPU platform?

I've an assembly which is built against "AnyCPU" platform on .NET 4.5.2 But when i run the assembly on a 64 bit machine the dll is taking 32 bit form, After researching a lot i came to know about ...
Premz's user avatar
  • 71
0 votes
0 answers
566 views

Why corflags.exe can't change PE32+ to PE32?

I always build my assemblies to x64 platform, but now my client asked me to provide assemblies of the two platforms (x86 & x64). So, I think I can use corflags.exe to change PE32+ to PE32 after ...
Uni's user avatar
  • 1
0 votes
0 answers
255 views

Load dll with Platform target 'Any CPU' in Python

I have a dll which was built with platform target 'Any CPU'. I am trying to write a Python script which loads this dll and getting an 'Could not load assembly or one of its dependencies' error message....
lerner1225's user avatar
6 votes
2 answers
4k views

Why is my 64 bit service running as 32 bit?

I have a Windows Service that I'm having this issue with. In Visual Studio I've set its Platform Target to 64 bit I've run CorFlags to verify that it is set correctly, I get this: Version : v4....
snappymcsnap's user avatar
  • 2,009
1 vote
1 answer
1k views

CorFlags versions for VS 2008, VS 2010, VS 2012, VS 2013

I have installed VS 2008, VS 2010, VS 2012 and VS 2013. I have found 8 files CorFlags.exe in subfolders in C:\Program Files (x86)\Microsoft SDKs\Windows\ (for example, one of them is C:\Program ...
Kiquenet's user avatar
  • 14.4k
65 votes
4 answers
37k views

Interpreting the CorFlags flags

How do I interpret the CorFlags flags and how should I use it to determine if a .NET assembly was built for x86 or x64? Could it be the following? corflags MyAssembly.dll
user avatar
4 votes
1 answer
6k views

Why does my website need "Enable 32-bit applications"?

I've just been working on migrating a staging web site from II6 to IIS8. IIS8 comes with an option Enable 32-Bit Applications which is a true false flag. The explanation of this flag is: [...
Liam's user avatar
  • 27.2k
1 vote
3 answers
7k views

Corflags.exe cf001 Could not open file for wiriting

I am trying to edit the corflags file so that I can run 32bit applications on a 64 bit pc but everytime I try to edit the file using something like corflags.exe assembly /32bit+ it comes up with the ...
user2127063's user avatar
13 votes
2 answers
3k views

Where can I find a reference for what every bit of the CorFlags value means?

I'm messing around with some rather low level things and trying to determine why I get different outputs with the CorFlags.exe utility. For reference, the outputs are as so: $ corflags test2.exe ...
Earlz's user avatar
  • 61.8k
2 votes
1 answer
889 views

Prefer32Bit Flag on project file

When changing a project from targeting .NET 4 to .NET 4.5 I get the following added to the project file for each build configuration: <Prefer32Bit>false</Prefer32Bit> What does this mean?...
NikolaiDante's user avatar
  • 18.4k
1 vote
1 answer
211 views

Can I re-sign a 3rd party assembly?

I have a project, which is intended to be run under x86 platform, but I have a 3rd party assembly which gives me a BadImageFormatException. I could use corflags utility to set the 32BIT flag, but then ...
vyakhir's user avatar
  • 1,684
13 votes
2 answers
8k views

How does CorFlags.exe /32BIT+ work?

I guess my question is about the CLR Loader. I want to understand the mechanics behind CorFlags.exe /32BIT+ functionality. We know that when one starts an assembly compiled with the Any CPU flag set ...
Nullptr Dev's user avatar
1 vote
0 answers
421 views

Compile ILONLY=0 32BIT=1 in Visual Studio 2010 Express (VB.NET)

How can I make VB.NET (Visual Studio 2010) compile an assembly with PE32, ILONLY=0, and 32BIT=1? Or must I continue to post-process it with corflags.exe? I'm starting to get the impression this is ...
Timberline's user avatar
0 votes
1 answer
809 views

Windows 7 x64 Edition and Visual Studio 2010 dll reference

I used to use Visual Studio 2008. Then I decided to take Windows 7 x64 and Visual Studio 2010 to use new IDE features inside of the our development cycle etc. One of our projects is using Microsoft....
fyasar's user avatar
  • 3,986
1 vote
1 answer
752 views

Problem with corflags on interop library after VS upgrade

I converted my visual studio solution from 2008 to 2010. A project has a reference to ShDocVw. When I run the program I get a BadImageFormatException. Googling led me to check the interop library ...
Skrymsli's user avatar
  • 5,125
12 votes
6 answers
20k views

How to force .NET application to run in 32bit mode

I am trying to run my .NET 3.5 WinForms application on a Win7 x64. The application uses NHibernate and the System.Data.OracleClient to access an Oracle database. The Oracle client is 32bit. When ...
chiccodoro's user avatar
  • 14.4k
0 votes
1 answer
744 views

Running a 32-bit window service which loads a 32-bit dll as a 64-bit service

Here's the situation - A window service which I am coding uses Linq2Excel, which insist the invoking application to be complied against x86. However, the window service is to be installed on a 64-...
Extrakun's user avatar
  • 19k
2 votes
5 answers
7k views

How do you make a .NET executable run as a 32-bit process on a 64-bit OS?

I want to make my .NET application run as a 32-bit process on a 64-bit machine with .NET1.1. The target platform option was introduced in later versions of VS(2005), but I am using VS2003 and .NET1.1 ...
Armen Tsirunyan's user avatar
2 votes
1 answer
441 views

How to generate a 32bit only Managed C++ Assembly

I need to compile a DLL in Managed C++ in Visual Studio 2005. I want it with 32Bit corflag on. See http://illuminatedcomputing.com/blog/?p=117 for reference. By default, I choose Win32 platform ...
Robert's user avatar
  • 21
26 votes
2 answers
34k views

Where is CorFlags.exe? (.NET Framework Tools)

Where can I find the CorFlags.exe tool? I made full search of my hard disk drive, but it was not found. I have: .NET Framework 4.0, Visual C# 2010 Express, Visual C++ 2010 Express. The OS is Windows ...
Edward83's user avatar
  • 6,644
1 vote
1 answer
855 views

Does ILOnly = 0 mean C++/CLI?

Does ILOnly=0 when using corflags means the assembly is built using C++/CLI?
user496949's user avatar
  • 82.6k
47 votes
3 answers
26k views

What's the difference between PE32+ and PE32?

When running CorFlags on some DLL file, some show as PE32 and some show as PE32+. What's the difference?
user496949's user avatar
  • 82.6k
1 vote
1 answer
1k views

Understanding an assembly header with CorFlags (why my assembly loads in 32-bit address space?)

I've found a fair bit of information related to how a .NET assembly should load based on the flags set in the assembly header. Pages such as Flipping bits on managed images to make them load with the ...
jmellor's user avatar
  • 11
1 vote
2 answers
2k views

Trying to run corflags from TFS Build 2010

I am using an InvokeProcess activity in TFS 2010 to try and run the corflags application on a built exe. C:\Builds\4\testing\Sources\BuildAssets\corflags.exe C:\Builds\4\testing\Binaries\Executable....
Swaff's user avatar
  • 13.5k
2 votes
3 answers
2k views

PartCover 2.5.3 win 7 x64

Could you tell me how you got PartCover running with VS2008 and win 7 x64? Based on this post How do I run PartCover in x64 windows, I ran c:\Program Files (x86)\Gubka Bob\PartCover .NET 2.3>...
gapo's user avatar
  • 505
2 votes
1 answer
282 views

Why is a .NET x86 windows service not displayed with *32 in Task Manager?

I created a dummy windows service using .net 3.5. The service has been compiled for x86 explicitly (32BIT corflag is set). Process Explorer from SysInternals correctly identifies the process as a 32-...
Alex's user avatar
  • 1,997
2 votes
3 answers
3k views

How to detemine (by code) the assembly corflags?

I need to write a CorFlags-like application. If I have a path to assembly file, how to I read its CorFlags? I specifically need to know if the assembly is Any-CPU or x86 only I want to avoid loading ...
Saar's user avatar
  • 1,733
2 votes
1 answer
4k views

CorfFlags warning CF011 about strong name signed even after /force

Im trying to use Corflags to get PartCover running under x64. When I use: CorFlags.exe PartCover.exe /32BIT+ /Force i get: corflags : warning CF011 : The specified file is strong name signed. Using ...
bosko's user avatar
  • 25
4 votes
4 answers
3k views

How to programatically set or clear the 32BIT flag?

When compiling, I always set it for Any CPU. However there are some customers that do not have a 64 bit version of a required binary, even when running on an x64 system. In these instances I have ...
esac's user avatar
  • 24k
0 votes
1 answer
5k views

NCover on 64 bit - CorFlags fix - corflags : error CF008 : The specified file does not have a valid managed header

I'm trying to apply a fix to allow NCover v1.5.5 to run on Windows Server 2008 X64 via my TeamCity Continuous Integration server as outlined on this blog: http://abdullin.com/journal/2008/6/6/how-to-...
David P's user avatar
  • 3,604
2 votes
2 answers
2k views

Why doesn't the corflags utility warn when marking x64 assemblies as x86?

If I set the platform flags of MyApp.exe to be x64 I still can run the corflags utilty like this: corflags /32bit+ MyApp.exe corflags will happily set the 32bit flag to 1. Of course when I'll try ...
Ohad Horesh's user avatar
  • 4,310
5 votes
2 answers
1k views

x64 .NET compilation / Process Explorer oddity

Apologies if any of what I'm about to say makes no sense or overlooks something obvious - my knowledge of CLR internals is spotty. If I understand correctly, then if I just build a solution for '...
alexis.kennedy's user avatar
22 votes
5 answers
75k views

Where should I download CorFlags.exe from?

I'm running Windows Server 2008 64-bit "workstation" and would like to get corflags.exe. Which SDK do I need to download? I know about .NET Framework 2.0 Software Development Kit (SDK) (x64) and ...
mmiika's user avatar
  • 9,910