且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows RT 和 c#

更新时间:2023-02-17 13:16:05

让我用最直接的方式回答你.如果您打开一个空白 XAML/C# Windows 应用商店项目.该项目将在 Windows RT (ARM) 和 Windows 8 (x86/x64) 上运行.那是因为它是为实现这一目标而构建的.仅仅因为您拥有 .Net Framework 的感觉,不用担心 - 您正在编写一个跨平台的应用程序.

Let me answer you in the most direct way I can. If you open a Blank XAML/C# Windows Store project. That project will run on Windows RT (ARM) and Windows 8 (x86/x64). That's because it is built to accomplish this. Just because you have what feels like the .Net Framework, don't worry - you are writing a cross-platform application.

现在,请注意.由于 C#,您使这个答案变得容易.CPP 开发人员没有相同的保证,因为他们可以做一些编码来破坏这种兼容性.在 C# 中并非如此.如果您编写的代码编译为任何 CPU",那么我所说的是正确的.

Now, for the caveats. You made this answer easy because of C#. CPP developers don't have the same guarantee because there are coding things they can do to break this compatibility. Not so in C#. If the code you write compiles to "Any CPU" then what I am saying is correct.

如果您引入需要构建从任何 CPU"更改为其他内容的内容(例如 Bing 地图控件).Windows 应用商店将允许您以相同的名称提交应用的三个版本 - 每个平台一个版本 - 用户永远不会知道有多个版本.

If you introduce something (like the Bing Maps control) that requires your build to change from "Any CPU" to something else. The Windows Store will let you submit three versions of your app under the same name - one for each platform - and the user will never know there is more than one.

在最后一个示例中,您仍然支持每个平台,您只需要指定三个不同的构建来完成它 - 您的代码可能根本不会改变!在大多数情况下,您都支持它们.如果你引入了第三方库——比如 MVVMlite——如果你可以构建到任何 CPU,你仍然可以.大多数图书馆都是这样的.

In that last example, you are still supporting every platform, you just have to specific three different builds to accomplish it – your code may not change at all! In most scenarios, you support them all out of the gate. If you introduce a third party library - like MVVMlite - you are still okay if you can build to any CPU. Most libraries are cool like that.