anycpu

Compiling as AnyCPU produces assembly with 32BIT flag set on 64-bit machine

无人久伴 提交于 2020-01-07 02:27:06
问题 I've created a brand new .NET 4.5 WinForm project in Visual Studio 2013 on a 64-bit machine. After compiling, I run corflags in the .exe and the 32BIT flag is set. Version : v4.0.30319 CLR Header: 2.5 PE : PE32 CorFlags : 131075 ILONLY : 1 32BIT : 1 Signed : 0 When I take a look at Task Manager, it's also marked as a 32 bit process. I didn't add any references that would maybe force it to run in 32-bit mode. I took a look at the project file and didn't spot anything suspicious either. I can

Build platform target AnyCPU EXE still shows 32bit header in 64bit machine

我只是一个虾纸丫 提交于 2019-12-24 02:42:51
问题 Not sure this has been asked before (I could not find any). I have simple console app/ESE and have the below settings. I'm running Windows 8, 63bit OS. And the EXE target framework .NET 4.5 However, when I compile this EXE, it still shows as a 32bit EXE. Since this is "Any CPU", I would expect the EXE to compile as 64bit / PE32+. Can some please help tell why this would be still 32bit? 回答1: You are misinterpreting CorFlags I think. Here is a CorFlags truth table: CPU Architecture PE 32BITREQ

How can I change the Build.Platform property in a Visual Studio project?

点点圈 提交于 2019-12-21 14:36:14
问题 One of the many projects in a very large solution somehow became set to Build Platform == Active (x86). I want it to match all of the other projects ("Any CPU"). I successfully changed the Platform target dropdown from "Active (x86)" to "Any CPU", but the Platform dropdown has "Active (x86)" as the only option: I don't know how this project got "out of sync" with the others as to this setting to begin with, and more importantly how to get it back in line with the others... UPDATE I think the

How to add x64 (or Any CPU) as a build option in Visual Studio 2010 (from console application to class library)

狂风中的少年 提交于 2019-12-17 16:35:11
问题 Initially, I created a console application using Mass Transit as my service bus. Recently, I switched to NServiceBus, which doesn't require you to make a console application, but a class library instead. In the project properties, I simply switched the setting that changes it from a console application to a library, but the constraint that you can only build it for x86 is still in effect. I can't change the build type to Any CPU now that it is a console application, which should now be valid.

.Net2 assemblies hosted in .Net4 app perform better in x86 than in AnyCpu mode?

匆匆过客 提交于 2019-12-07 05:28:29
问题 I have a .Net4 WinForms app that references 3rd party .Net2 assemblies, which contain graphics-heavy visual controls. I've noticed a huge improvement in app's visual performance when I accidentally switched it from AnyCpu to x86 compilation mode. My development rig is a x64 Windows 7. The improvement is by a factor of at least two when controls are rendering their graphical elements. Is this a known fact or am I doing something wrong? 回答1: See these two articles about it: AnyCPU Exes are

Managed C++ and AnyCPU

白昼怎懂夜的黑 提交于 2019-12-06 22:27:35
问题 I have a Managed C++ dll that I am referencing from a C# project. The C# project will be compiled as AnyCPU. Is there any way to compile a 32-bit and 64-bit version of the Managed C++ dll and then tell the C# project at runtime to load the correct one depending on which architecture it is being run? 回答1: The trick to getting the AnyCPU dll to play with the C++ dll, is at runtime make sure the assembly cannot load the C++ dll and then subscribe to the AppDomain AssemblyResolve event. When the

How can I change the Build.Platform property in a Visual Studio project?

送分小仙女□ 提交于 2019-12-04 08:38:45
One of the many projects in a very large solution somehow became set to Build Platform == Active (x86). I want it to match all of the other projects ("Any CPU"). I successfully changed the Platform target dropdown from "Active (x86)" to "Any CPU", but the Platform dropdown has "Active (x86)" as the only option: I don't know how this project got "out of sync" with the others as to this setting to begin with, and more importantly how to get it back in line with the others... UPDATE I think the problem may have been that my VS install was set to VB instead of C# (it was done by IT, and most of

Any CPU not available in C++/C# solution

二次信任 提交于 2019-11-30 00:24:22
I have a solution that contains C# and managed C++ projects. It compiles in the solution platform x64 and x86. Since it is managed C++ I wanted to create a 'Any CPU' solution and get rid of the old ones. I changed the C++ project linker settings to Force Safe IL Image for both x64 and x86. Next, using the Configuration Manager, I created a new solution platform called 'Any CPU'. Next I added a project platform also called 'Any CPU'. I proceeded to set all the C# projects to 'Any CPU', but for the C++ I can't do that. The project platform 'Any CPU' is not in the drop down, and there is also no

Any CPU not available in C++/C# solution

家住魔仙堡 提交于 2019-11-28 21:22:23
问题 I have a solution that contains C# and managed C++ projects. It compiles in the solution platform x64 and x86. Since it is managed C++ I wanted to create a 'Any CPU' solution and get rid of the old ones. I changed the C++ project linker settings to Force Safe IL Image for both x64 and x86. Next, using the Configuration Manager, I created a new solution platform called 'Any CPU'. Next I added a project platform also called 'Any CPU'. I proceeded to set all the C# projects to 'Any CPU', but for

How to add x64 (or Any CPU) as a build option in Visual Studio 2010 (from console application to class library)

余生颓废 提交于 2019-11-27 23:35:51
Initially, I created a console application using Mass Transit as my service bus. Recently, I switched to NServiceBus , which doesn't require you to make a console application, but a class library instead. In the project properties, I simply switched the setting that changes it from a console application to a library, but the constraint that you can only build it for x86 is still in effect. I can't change the build type to Any CPU now that it is a console application, which should now be valid. Is there any way to completely change my application to a class library so that I can run the build