C# Winform application error if i target Any CPU or x64

640 Views Asked by At

Im developing a simple winform application which i would like to deploy to a mix of pcs - some x64 and some x86.

The application searches the harddrive for files containing text the user enters, and uses a backgroundworker to to the actual search so as not to lock the UI.

While still in visual studio, when i change the architecture of the winform project to 'Any CPU' or 'x64' and use F5 to load the application and enter a search term, i get the following error:

enter image description here

I'm targeting .NET framework 3.5

The application is fine and runs with no error when i Change it back to x86. I would like all users to be able to use the application and would appreciate some help in solving this.

thanks

EDIT 3

Another problem i have discovered is the application opens but returns no data when published or even from the debug folder after building ! Its just a winform with a datagridview and textbox on it. Any ideas?

1

There are 1 best solutions below

0
On

Issue is probably with some DLL that you've added to your project. Some libraries fail on x64 or AnyCPU. I've had such issue last year.

Regarding:

I would like all users to be able to use the application and would appreciate some help in solving this.

If you compile it to x86, users should be able to use it on 64-bit machines without issue.