Azure Sphere–“Object reference not set to an instance of an object” 解決辦法


在開發Azure Sphere應用時,如果出現項目無法編譯,出現“Object reference not set to an instance of an object”時,必須從下面兩個方面進行檢查。

1. 檢查Visual Studio 2017安裝時,是否安裝了Desktop Development with C++組件,另外,是否選中了"Visual C++ tools for CMake and Linux" 和 "Embedded and IoT Development"這兩個項目,如下圖所示。

image

2. 安裝完成以后,去https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache這里下載Visual Studio的MEF組件清理插件並安裝。安裝完成以后,在Visual Studio 2017的Tools-Clear MEF Component cache菜單中清除Cache。

image

3.之后,用Visual Studio打開Azure Sphere的工程,點擊Build-Rebuild Solution,就可以重新編譯項目了。

image


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM