win-universal-app – Windows通用应用程序 – Windows 10的“任何CPU”配置?

我正在更新创建的Windows通用项目

Windows 10技术预览的Windows软件开发工具包(SDK)

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

所以解决方案文件的更改只有VisualStudioVersion从14.0.22609.0到14.0.22823.1.

项目文件的更改也很小:

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

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

问题是,原来这个通用项目已经成功构建成任何CPU配置,但现在我开始收到以下错误:

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”.

所以消息是明确的做什么,只是想确认:

是否真的这样,任何CPU都不可能从“Windows 10内幕预览的SDK”开始的通用项目?

更新

新创建的项目也没有AnyCPU – 默认的是x86.

而这里是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.

更新1

从这个视频 – Deep Dive into XAML and .NET Universal Windows App Development,转发到0:32:28 – 似乎有一个(小)的机会回到“任何CPU”的版本:

更新2

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.

所以在我看来,希望恢复“AnyCPU”配置几乎就是对于VS2015 RTM.

更新3

那么,the RTM is finally here和预期的 – 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.

http://stackoverflow.com/questions/29979047/windows-universal-app-no-any-cpu-configuration-for-windows-10

转载注明原文:win-universal-app – Windows通用应用程序 – Windows 10的“任何CPU”配置?