VS2015编写Win10通用应用提示error CS0012的问题解决方案

1>------ 已启动生成: 项目: App6, 配置: Debug x86 ------
1>C:\Users\Administrator\documents\visual studio 2015\Projects\App6\App6\MainPage.xaml.cs(33,26,33,67): error CS0012: The type 'IAsyncAction' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
1>C:\Users\Administrator\documents\visual studio 2015\Projects\App6\App6\MainPage.xaml.cs(33,26,33,67): error CS0012: The type 'IAsyncActionWithProgress<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
1>C:\Users\Administrator\documents\visual studio 2015\Projects\App6\App6\MainPage.xaml.cs(33,26,33,67): error CS0012: The type 'IAsyncOperation<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
1>C:\Users\Administrator\documents\visual studio 2015\Projects\App6\App6\MainPage.xaml.cs(33,26,33,67): error CS0012: The type 'IAsyncOperationWithProgress<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.



测试了一下Win10的通用应用,结果莫名其妙就遇到了这个问题,资料翻了一下午,尝试了各种方法,没有发现什么可用的解决方案。


然后我在另一个没有装过VS2015的机器上直接安装VS2015+Win10SDK,同样的代码没有任何问题。



总结,你肯定之前安装过RC版本的VS2015,或者有卸载重装过VS2015。 


希望刚开始折腾windows通用应用的同学,遇到这个问题不要浪费时间了!

请跟我一起重装系统吧!因为修复重装VS2015什么的都没用的!



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章