Can Windows Store apps be compiled as x86 instead of AnyCPU?

1k Views Asked by At

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 a Metro app be compiled as x86 and still be distributed on the Windows Store? Is being compiled as x86 going to stop it from being able to run in Windows RT? Would I have to come up with a version without this subset of functionality to run in Windows RT? If I can get the code into its own assembly can I just have the Windows RT version not use it? (so, the main executable is AnyCPU and this one assembly is x86).

2

There are 2 best solutions below

0
On

Just compile whatever libs you need and when you upload to app store just upload the one you want to. Check your apppackages folder and look for the .appxupload files.

2
On

Can a Metro app be compiled as x86 and still be distributed on the Windows Store?

Yes. However, it would only be installable for x86 installations.

Is being compiled as x86 going to stop it from being able to run in Windows RT?

Since Windows RT is designed to run only on ARM CPUs, compiling for x86 will stop it from being able to run on Windows RT.

Would I have to come up with a version without this subset of functionality to run in Windows RT? If I can get the code into its own assembly can I just have the Windows RT version not use it?

You could use conditional compilation symbols to include/exclude functionality as required in your code. https://stackoverflow.com/a/6587823/61385 shows an example of how to do this.