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什麼的都沒用的!



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