Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Universal app - no "Any CPU" configuration for Windows 10?

I'm updating Windows Universal project that was created with

Windows Software Development Kit (SDK) for Windows 10 Technical Preview

to

Windows Software Development Kit (SDK) for Windows 10 Insider Preview:

So the solution file's changes is only VisualStudioVersion from 14.0.22609.0 to 14.0.22823.1.

The project file's changes are also minor:

<TargetPlatformVersion>10.0.10030.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10030.0</TargetPlatformMinVersion>

to

 <TargetPlatformVersion>10.0.10069.0</TargetPlatformVersion>
 <TargetPlatformMinVersion>10.0.10069.0</TargetPlatformMinVersion>

The issue is that originally this universal project has been built successfully against Any CPU configuration, but now I'm started getting the following error:

The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.NET.CoreRuntime, Version=1.0". Please consider changing the targeted processor architecture of your project (in Visual Studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM".

So the message is clear what to do, just want to confirm:

Is that really so that Any CPU is no longer possible for universal projects starting from "SDK for Windows 10 Insider Preview"?

Update

There is no AnyCPU for the newly created project as well - the default one is x86.

like image 281
Sevenate Avatar asked Apr 30 '15 22:04

Sevenate


1 Answers

And here comes the answer:

  1. Open your solution that contains your C# Windows Universal app. You will see that your project file (.csproj file) needs to be updated. Right-click the project file and choose to edit this file.

  2. Find the <PropertyGroup> element that contains the <TargetPlatformVersion> ... Next, set the value of the <Platform> element to x86 ...

  3. Find <PropertyGroup> elements that are configured for the AnyCPU platform as part of the Condition attribute. Remove these elements and all of their child elements. AnyCPU is not supported for Windows 10 apps in Visual Studio 2015 RC.

UPDATE 1

From this video - Deep Dive into XAML and .NET Universal Windows App Development, forward to 0:32:28 - it seems like there is a (small) chance to get back "Any CPU" in the release:

Screenshot from Deep Dive into XAML and .NET Universal Windows App Development video

UPDATE 2

One more confirmation from Visual Studio 2015 RC fixed bugs and known issues:

The AnyCPU platform configuration is not supported for Windows 10 Insider Preview applications that are built by using C# and Visual Basic. This release of Visual Studio uses the .NET Native to build Windows 10 applications. The .NET Native compiles C# and Visual Basic code to native code and is not CPU-agnostic.

So it seems to me that hope for getting back "AnyCPU" config is almost gone even for VS2015 RTM.

UPDATE 3

Well, the RTM is finally here and as expected - no AnyCPU:

Find elements that are configured for the AnyCPU platform as part of the Condition attribute. Remove these elements and all of their children. AnyCPU is not supported for Windows 10 apps in Visual Studio 2015.

like image 72
Sevenate Avatar answered Sep 20 '22 18:09

Sevenate