Windows通用应用 - Windows 10没有“任何CPU”配置?

问题描述:

我更新,将其与Windows通用应用 - Windows 10没有“任何CPU”配置?

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

Windows Software Development Kit (SDK) for Windows 10 Insider Preview的Windows通用项目:

所以解决方案文件的更改仅为VisualStudioVersion from 14.0.22609.014.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配置,但现在我m开始出现以下错误:

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不再可能从“SDK的Windows 10内幕预览”开始普及的项目?

更新

没有AnyCPU新创建的项目,以及 - 一个默认为。

+0

请记住,您正在使用的SDK可以并且会改变,错误和所有。 – SteveFerg

+0

@SteveFerg,当然。想知道它可能是“设计”还是只是一个错误。 – Sevenate

+1

这对我来说也是令人惊讶的,有点感觉像是一个需求而不是bug。用File new项目也是这样,不支持任何Cpu – Quincy

这里来的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,期待○时32分28秒 - 好像有一个(小)在发行版中找回“Any CPU”的机会:

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

更新2

还有一个确认:

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.

+0

非常感谢。我们称之为 - AnyCPU不受支持!哇有趣 – Quincy

+0

最终VS2015会得到支持吗? –

+0

@RicoSuter也许:) – Sevenate

我假设你正在点击你的项目去属性。在平台下的“Build”的顶部,您有ARM,x64,x86和所有平台。在“常规”组框中稍微有点“平台目标”,它可以为您提供任何CPU,x86,x64和ARM。

如果您正在查看配置管理器(构建 - >配置管理器),您是对的只有ARM,x64,x86,新...并编辑....如果您单击新建.. 。“任何CPU”是一个可以添加的选项(默认),然后您可以返回并选择它以进行配置。

+1

真的希望这会起作用,但是,不幸的是 - 即使将配置更改到任何CPU,仍然会在问题中引用错误。我怀疑这里的关键词是:“......任何CPU都不被所引用的SDK支持”以及“......由SDK_支持的体系结构之一:”x86,x64,ARM“”。 – Sevenate

好,AnyCPU仍然存在对DLLWindows运行时组件项目类型。 AnyCPU的缺失是由于发布配置中的通用Windows应用默认使用.NET Native引起的。如您所知,.NET Native将应用程序及其所有依赖关系链接到一个EXE中,所以这就是为什么AnyCPU仍然存在于DLL和WinRT组件中的原因。

现在我不确定,但DevDiv家伙似乎在收集关于.NET Native的“默认设置”的反馈,所以如果有足够的反馈,AnyCPU仍然可能会在RTM或RTM之后返回。不过,我相信.NET Native是值得的,因为您通常会通过Store部署您的应用程序。

+0

我会说,通常我部署_my_应用程序完全通过侧面加载和从我部署_other其他人的应用程序的商店。 – Sevenate

+0

但无论如何,至少为运行时组件项目提供AnyCPU是很好的做法。 – Sevenate

+2

我是一个“devdiv人”。 .NET Native对于商店应用程序是强制性的。 Unni提到的唯一一件关于“寻找反馈”的东西是,如果你足够爱AnyCPU,那么也许我们可以“伪装” - 也就是说,你可以选择AnyCPU,然后询问你的目标设备它是什么架构,然后隐式选择那个架构。应用程序本身永远不能真正成为AnyCPU。 –