2015-04-30 26 views
18

我更新,將其與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

回答

19

這裏來的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

1

我假設你正在點擊你的項目去屬性。在平臺下的「Build」的頂部,您有ARM,x64,x86和所有平臺。在「常規」組框中稍微有點「平臺目標」,它可以爲您提供任何CPU,x86,x64和ARM。

如果您正在查看配置管理器(構建 - >配置管理器),您是對的只有ARM,x64,x86,新...並編輯....如果您單擊新建.. 。「任何CPU」是一個可以添加的選項(默認),然後您可以返回並選擇它以進行配置。

+1

真的希望這會起作用,但是,不幸的是 - 即使將配置更改到任何CPU,仍然會在問題中引用錯誤。我懷疑這裏的關鍵詞是:「......任何CPU都不被所引用的SDK支持」以及「......由SDK_支持的體系結構之一:」x86,x64,ARM「」。 – Sevenate

3

好,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。 –

相關問題