Any CPU is a build target for .net Applications which are compiled using the Visual-Studio IDE
Questions tagged [anycpu]
97 questions
5
votes
2 answers
C# Solution, can all projects target AnyCPU except one which has to be x86?
We have a large solution comprising of many different libraries. We have just migrated to development on a 64bit system and this has us thinking about what platform target we should specify for each individual project in the solution.
At the current…

Horges
- 73
- 1
- 6
5
votes
1 answer
.NET application loading mixed dll, using Any CPU
I am new to creating .NET applications, esp mixed applications.
Recently I have created a set of (static) libraries for a client in (unmanaged) C++ (under MS Visual Studio 2010), supporting both 32-bit and 64-bit compiles, which were loaded by some…

Bjoern
- 633
- 6
- 16
5
votes
1 answer
.NET AnyCPU project links platform specific library
Possible Duplicate:
Loading x86 or x64 assembly
I'm trying to compile Any CPU .NET project, but I have to link SQLite library which has different versions for x86 and x64 platforms. Changing only DLL versions to x64 doesn't help, application…

axe
- 2,331
- 4
- 31
- 53
4
votes
1 answer
does the x86 and x64 options mean anything to a windows phone 7 app?
As this screen shot shows, we can still choose x86, x64 and anycpu for a windows phone 7 app.
But does it make any difference to the wp7 app?
Thanks

Cui Pengfei 崔鹏飞
- 8,017
- 6
- 46
- 87
4
votes
1 answer
.NET Core 3.1 Console App will not run on Windows 7
I created a .NET Core 3.1 AnyCpu Console Application using Visual Studio 2019 with the latest patches. The only code it contains is the boilerplate Console.WriteLine("Hello World!") it was created with. I compile this and it runs fine on my Windows…

making
- 408
- 6
- 21
4
votes
0 answers
This 64-bit process failed to load the library R.dll. Native error message is 'The operation completed successfully'
I have a .net program that is built on .net framework 4.7.2, which call upon the rdotnet DLL (which is built on .net standard 2.0) to run R script, both the program and the DLL are compiled for the 'Any CPU' platform, when I deploy it to a 64-bit…

For Comment
- 1,139
- 4
- 13
- 25
4
votes
1 answer
How to combine two managed x86/x64 dlls into one managed AnyCpu library?
A third party compiles unmanaged code (x86/x64 separated) and provides managed C# .NET dlls for either platform (x86/x64 separated):
FooManaged_x86.dll
FooManaged_x64.dll
This is what I receive (neither native code, nor unmanaged dlls).
I can then…

Patrick Stalph
- 792
- 1
- 9
- 19
4
votes
1 answer
AnyCpu reference x64 valid?
Is it a valid scenario to reference an x64-dll from an AnyCpu dll when the system it will run on is for sure a 64bit System?
I'm asking, because I had issues here, getting an exception as follows:
"Could not load file or assembly 'XY' or one of…

DanielG
- 1,217
- 1
- 16
- 37
3
votes
2 answers
Building all projects of a solution with a mixture of x86 and "any cpu" projects using MSBuild
Is it possible to be able to build all projects of a solution with x86 and "any cpu" projects in it from MSBuild?
Ideally I would like a solution that would work regardless of whether the project has multiple platforms or not because it's often not…

Helephant
- 16,738
- 8
- 39
- 36
3
votes
1 answer
Including 32- and 64-bit merge modules in one WiX installer
I'm writing merge modules for a project I'm working on.
I build two merge modules, one for 32-bit and one for 64-bit. I want to include them in a WiX installer but it tells me I can't:
error LGHT0345: 'installer\bin\x64\Release\en-us\myproject.msm'…

erik
- 111
- 1
- 6
3
votes
0 answers
How to publish net core project to AnyCPU?
I use this command
dotnet publish -c Release --force -r **win-x86** --self-contained true
try to publish a project, while I want to publish a any cpu project, with
dotnet publish -c Release --force -r **AnyCPU** --self-contained true
dotnet…

Ming Tong
- 105
- 1
- 8
3
votes
1 answer
C# AnyCPU and Read/WriteProcessMemory
My C# program is compiled with AnyCPU option and i am using P/Invoke to call native apis this way:
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer,…

thatoneguy
- 45
- 1
- 3
3
votes
1 answer
MSBuild: Avoiding repeatedly building Any CPU project references
We have a visual studio solution with around 150 projects. 5 of these are executable, the other 95 are libraries which the executables reference, or test projects, etc.
Our automated CI builds the solution via MSBuild for both x86 and for x64.…

Rob
- 4,327
- 6
- 29
- 55
3
votes
1 answer
Application runs as x86 in unit tests in Visual Studio, but runs as x64 when it stands alone
this line of code
Environment.Is64BitProcess
Evaluates to true when my app is running standing alone.
But the same expression evaluates to false when it's running in my unit tests in Visual Studio.
I have chosen "Any CPU" as the solution platform,…

Cui Pengfei 崔鹏飞
- 8,017
- 6
- 46
- 87
3
votes
0 answers
Why does Process.Start from my app causes Outlook to crash?
I have an app that sits in the system tray and monitors certain events. Upon a specific event, it fires off a Process.Start with a "mailto" link. When that happens the Outlook New Mail window briefly comes up and then it crashes.
I am on a 64-bit…

AngryHacker
- 59,598
- 102
- 325
- 594