none
Migrate my winform application from x86 to Any CPU RRS feed

  • Question

  • my application loading large data & we know 32 bit app can use only 2GB so i change it to any CPU as a result when my application will run on 64 bit PC then it can allot more memory for my large data. one problem occur after change from x86 to ANY CPU. many form often gets not responding when it load data & those data is not heavy.

    can you tell me why this happen after change from x86 to ANY CPU?

    Friday, August 9, 2019 7:03 AM

Answers

  • Unless you have a dependency on native components changing from x86 to Any CPU just requires that you change the platform in the project. But note that this should be the default already (unless your app is really old). Back around 2015 or so the default was changed to Any CPU and a new flag was added to prefer 32 bit. Uncheck that box in your project settings and your app is x64 on an x64 OS.

    If you are connecting to databases then note that you are now using the x64 drivers so you need to ensure they are installed. In most cases drivers should install both versions (e.g. SQL) but if you're using a third party driver (e.g. Oracle) you may need to install the x64 component as well.

    If your app is now freezing then the issue was there before you just didn't see it because (perhaps) it wasn't loading all the data. You'll need to debug your app to figure out why it is freezing. Most likely you are making a request to load a lot of data on the UI thread and your app is stalling while it loads. This is independent of x86/x64 and will require that you modify how you load your data. For questions on how to do this please post in the forums appropriate for your UI.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by Sudip_inn Tuesday, August 13, 2019 7:15 AM
    Friday, August 9, 2019 1:53 PM
    Moderator

All replies

  • Unless you have a dependency on native components changing from x86 to Any CPU just requires that you change the platform in the project. But note that this should be the default already (unless your app is really old). Back around 2015 or so the default was changed to Any CPU and a new flag was added to prefer 32 bit. Uncheck that box in your project settings and your app is x64 on an x64 OS.

    If you are connecting to databases then note that you are now using the x64 drivers so you need to ensure they are installed. In most cases drivers should install both versions (e.g. SQL) but if you're using a third party driver (e.g. Oracle) you may need to install the x64 component as well.

    If your app is now freezing then the issue was there before you just didn't see it because (perhaps) it wasn't loading all the data. You'll need to debug your app to figure out why it is freezing. Most likely you are making a request to load a lot of data on the UI thread and your app is stalling while it loads. This is independent of x86/x64 and will require that you modify how you load your data. For questions on how to do this please post in the forums appropriate for your UI.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by Sudip_inn Tuesday, August 13, 2019 7:15 AM
    Friday, August 9, 2019 1:53 PM
    Moderator
  • It is very common for programmers to be lazy about checking for errors. It is very likely an error is occuring that is being ignored. If so then the problem will cascade into a more serious error such as what you are encountering that is difficult to diagnose. So it would help to go through the entire program and add error checking (such as try/catch blocks and checking for null objects) wherever that is appropriate. A quick solution might be to add a try/catch block at a high level and that might catch an error but it would be better to eventually use try/catch at lower levels too.


    Sam Hobbs
    SimpleSamples.Info

    Friday, August 9, 2019 7:04 PM