的MSBuild没有找到异步所需引用 [英] MSBuild doesn't find async required references
问题描述
我们已经安装了Visual Studio 2010 SP1和异步CTP(SP1刷新)。
We have Visual Studio 2010 SP1 and Async CTP (SP1 refresh) installed.
与使用项目异步/的await
A解决方案构建的关键字时,确定修建从VS IDE。
此外,当与 devenv的/建造内置调试solution.sln
一切正常。
A solution with projects that use async/await
keywords builds OK when build from VS IDE.
Also when built with devenv /build "Debug" solution.sln
everything is OK.
但的MSBuild @ commands.rsp solution.sln
报道:
File.xaml.cs(123): error CS1993: Cannot find all types required by the 'async' modifier. Are you targeting the wrong framework version, or missing a reference to an assembly?
commands.rsp看起来是这样的:
commands.rsp looks like this:
/nologo
/p:Configuration=Debug
/m:3
/fileLogger
任何线索?
推荐答案
请,请参阅这里的讨论:<一href=\"http://social.msdn.microsoft.com/Forums/uk-UA/async/thread/3d491cb0-a19f-4faf-80a6-5fd05e4e06db\" rel=\"nofollow\">http://social.msdn.microsoft.com/Forums/uk-UA/async/thread/3d491cb0-a19f-4faf-80a6-5fd05e4e06db
Please, refer to the discussion here: http://social.msdn.microsoft.com/Forums/uk-UA/async/thread/3d491cb0-a19f-4faf-80a6-5fd05e4e06db
有2个点,以更好地了解您的问题予以澄清:
There are 2 points to be clarified in order to understand better your problem:
- 环境:?是否安装VS11并排侧VS 2010 +异步CTP
- 您的项目:你在你的项目有用户控件XAML和CLR的命名空间 ?
我将列举由preliminary结论的 SERware 的来自于MS论坛讨论:
I will cite the preliminary conclusion by SERware from the discussion on the MS forum:
我认为这与为了把该项目XAML
指的是库本身的类时,编译组件。在
这种情况下,XAML装载机尝试有之前编译这个班
参照异步CTP库。所以,关键字异步不是
认可。
I think it has to do with the order in which the XAML projects compile assemblies when referring to classes of the library itself. In this case, the XAML Loader try to compile this classes before having reference to the Async CTP library. So, the keyword "async" is not recognized.
个人,我要看看是否有可能以解决依赖于XAML编译
Personally I am going to see whether it is possible to split the assembly in order to resolve the order of the compilation of the dependencies in XAML
在进一步调查后增加:
正如我已经找到了,其解释更是令人失望的:在.NET 4.5(测试版)取代了.NET 4.0。此外,异步的签名/等待相关的类型已经在内部改变。因此,有没有办法,到目前为止,VS 2010 + AsyncATP和VS11测试版同时使用。 - 尤里·S. 2分钟前
Added after further investigation: As I have found out, the explanation is even more disappointing: the .NET 4.5 (Beta) replaces the .NET 4.0. Besides, the signatures of the async/wait related types have been internally changed. Therefore there is no way so far to use simultaneously VS 2010+AsyncATP and VS11 Beta. – Yuri S. 2 mins ago
这篇关于的MSBuild没有找到异步所需引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!