1

WP8 の SDK のインストールが完了したばかりで、WP 7.1 と互換性のあるアプリを試してみたかったので、プロジェクトを開いてコンパイルしましたが、「async」と「await」を使用する部分でのみエラーが発生します。Async CTP を使用しましたが、WP8 はあまり好きではありません。アプリが WP と WP 8 7.1 の両方で機能するようにするにはどうすれば修正できますか? どうもありがとう!!!

4

2 に答える 2

3

You need to install this: https://nuget.org/packages/Microsoft.Bcl.Async

Blog about the targeting pack: http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx

Today, we are proud to announce an update to the Async Targeting Pack we had previously released. The previous targeting pack allowed you to use await when targeting .NET Framework 4.0 and Silverlight 5. Our updated targeting pack allows you to use await in Visual Studio 2012 when targeting any of the following platforms (or higher versions):

.NET Framework 4.0 (with KB2468871) Silverlight 4 Windows Phone 7.5 and portable class libraries targeting those platforms

于 2012-11-01T13:41:22.060 に答える
2

プロジェクトをアップグレードしないと、Windows Phone 8 SDK で Windows Phone 7.1 アプリケーションをビルドすることはできません。

アプリケーションの WP7.1 バージョンを async/await 機能で維持する場合は、WP7.1 用の Visual Studio Express 2010 + Async CTP 3 と、Windows Phone 用の VS2012 Express が必要です。

更新: この気の利いたNuGet パッケージを使用して、Visual Studio 2012 Express for Windows Phone で WP7 アプリケーションをコンパイルする方法があります。ただし、現在はプレリリース版であることに注意してください。

于 2012-11-01T11:23:57.153 に答える