Any CPU is a build target for .net Applications which are compiled using the Visual-Studio IDE
Questions tagged [anycpu]
97 questions
1
vote
2 answers
Can Windows Store apps be compiled as x86 instead of AnyCPU?
I have some .NET code that I am looking into porting into being a Windows Store app.
This code does a few different things and one of the things it does has a dependency on being compiled as x86 instead of AnyCPU.
Is this going to be a problem? Can…

Tom Kidd
- 12,830
- 19
- 89
- 128
1
vote
0 answers
I can't build VSTO solution in 64bits windows
I'm developing an Add-in for PowerPoint 2010.
If I try to build it with plataform target Any CPU or x64 I get HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)
My solution uses a hardware dll provided in a SDK and one of its libraries .
I have already…

oscargilfc
- 339
- 1
- 12
1
vote
3 answers
BadImageFormatException when trying to use TaskScheduler on Any CPU
We are trying to change a program from 32-bit to Any CPU. The program is in C# on .NET 3.5.
We are using Windows Task Scheduler COM wrapper.
The application compiles but when we try to run it on a 64-bit platform we are getting the following…

user1516849
- 55
- 1
- 8
1
vote
2 answers
VS create winforms apps only with x86 configuration, why?
I have VS.NET 10.0.40219.1 SP1 in 2 computers and when I create a new C# Winform app only do it with Properties/Build/Platform x86, and the target let me choose AnyCpu/x64, but can't set it in the configuration (however, libraries work fine).
If I…

mamcx
- 15,916
- 26
- 101
- 189
1
vote
1 answer
x86 vs AnyCPU returning different results on .Max() when used with ternary operator
https://github.com/qntmfred/FooTimestamp
The following program in the AnyCPU build configuration evaluates maxTimestamp as DateTime.MinValue.
public class Foo
{
public DateTime Timestamp { get; set; }
}
class Program
{
static void…

kenwarner
- 28,650
- 28
- 130
- 173
0
votes
3 answers
Platform target x86 and Any CPU
I have small problem with simple code. This code is working properly on "x86" mode but not on "Any CPU" mode, maybe it is possible to run one class on "x86" and another class on "Any CPU" mode? Code:
namespace Software_Info_v1._0
{
using…

zee
- 415
- 1
- 7
- 13
0
votes
1 answer
What types and versions of .NET libraries should I ship with my development tool?
I am working on a commercial .NET developer library that I hope to go public with and I want to know what versions of the .DLL I should provide out of the box to the end user (developers).
The .DLL might be executed in a wide variety of enviroments…

Tore Nestenius
- 16,431
- 5
- 30
- 40
0
votes
1 answer
BadImageFormatException with AnyCPU build
I have to use an old DLL for my current software that causes a BadImageFormatException when called during runtime. I have read that this is a typical 32 bit / 64 bit mismatch problem, so I set the target platform to x86 and it worked. However, when…

Thern
- 1,017
- 8
- 17
0
votes
1 answer
How to handle C# Third Party DLLs with Any CPU & Prefer 32-bit?
My application is built on "Any CPU" as the platform. It requires two, third-party DLLs.
For DLL #1, I must not check "prefer 32-bit" in my Build Settings in order to use it.
For DLL #2, I must check "prefer 32-bit" in order to use it.
How can I…

Mark Malburg
- 125
- 1
- 9
0
votes
0 answers
A 32 bit processes cannot access modules of 64 bit process
At my application starting I'm checking if same application is running and if it's true I kill previous process.
I'm doing it with the following code. I have to check companyName and copyrigth to ensure that I'll kill only process of my company and…

JuanDYB
- 590
- 3
- 9
- 23
0
votes
0 answers
Reference for .NET-Application has different files for x86 and x64 - how load the correct version at runtime?
I use TAPIEx.Net in my application to connect to a TAPI-Driver.
I compile my Application as AnyCPU. TAPIEx.Net has a x86 Version (TAPIEx.net.dll) and a x64 Version (TAPIex.net.x64.dll). For developing, I reference TAPIEx.net.x64.dll (because I…

BennoDual
- 5,865
- 15
- 67
- 153
0
votes
1 answer
Overflow operation when compiling using AnyCPU
I have a legacy solution written in VB.NET. It writes to a DB2 database using ODBC. I have a Textbox that is filled with a numeric value then I use ToString in order to cast whatever is written there and write it to the database using…

Joe
- 461
- 1
- 3
- 15
0
votes
0 answers
C#: Configuring a project for x64 platform in AnyCPU codebase
In my codebase there's a utility project of type lib: MyCode.Utility with TargetPlatform set to AnyCPU in its *.csproj file.
The project is then referenced by an executable, which also targets AnyCPU.
Now I need to introduce a new exe project to my…

LA.27
- 1,888
- 19
- 35
0
votes
0 answers
CefSharp AnyCPU Support (Option 4)
I have a VB.NET project (WinForms) which uses the CefSharp libraries and I want to apply the AnyCPU support using the option 4 based on the guide mentioned here.
Based on the requirements,
I'm not including the "CefSharpAnyCpuSupport" in the…

Andreas
- 23
- 3
0
votes
1 answer
How do you build a azure devops pipeline with mixed platform
I inherited a new C# project at work that I have been reading through the source code and building an Azure Dev-ops pipeline for
It has about multiple background threads and one Service
I am still a little new to Dev-ops Pipelines but I am not a …

thomedy
- 93
- 11