Windows 8 Store App with Windows Phone App

2019-09-09 09:15发布

问题:

May I know, can

  1. A Windows 8 Store App source project (Metro), link with binary reference initially created for Windows Phone 7?
  2. A Windows 8 Store App source project (Metro), link with binary reference initially created for Windows Phone 8?
  3. A binary Windows 8 Store App, run in Windows Phone 8?

I had tested (1) so far, by compiling a Windows 8 Store App project using Microsoft Face SDK for WP7. I get a mystery compilation error.

The "GenerateResource" task failed unexpectedly. System.InvalidOperationException: Item named 'resources/template/background/beard.01.jpg' of type 'System.IO.UnmanagedMemoryStream' cannot be added to the resource file because it is not serializable.

[... more goes here]

So, may I know [2] and [3] would work?

回答1:

As far as I know the answer is 1. no, 2. no and 3. no.

Windows Phone 7 and WinRT are completely different platforms.
Windows 8 and Windows Phone 8 shares part of WinRT, but there are still differences in available APIs. There are parts of the API available for Windows 8 and not for Windows Phone 8 and same works in the other direction too.

The best you can do is use Portable Class Libraries targeting both WinRT and Windows Phone 8 - this way you can use API available in both platforms and you can reference the created library both in WP8 and Windows 8 projects.