.Net 2015 References with yellow triangle for Nuget packages on portable libraries

后端 未结 7 1476
伪装坚强ぢ
伪装坚强ぢ 2021-01-01 10:04

I know the question has been asked before but none of the suggested resolutions are working for me so I\'m going to ask it again and hopefully get new suggestions. Some of t

7条回答
  •  死守一世寂寞
    2021-01-01 10:14

    I figured out what the problem was!

    As mentioned to @Gusman I had my warning switch off. Once I turned them on, I got the following displayed for my portable projects:

    Warning: IDE0006 - Error encountered while loading the project. Some project
    features, such as full solution analysis for the failed project and projects
    that depend on it, have been disabled
    

    and it provided a link to this article Diagnosing Project System Build Errors

    After following the instructions provided and inspecting the numerous files ending in designtime.log, I noticed that all of them had a FAIL referring to a Nuget package but as mentioned, I had removed all of them from my various project, so I went to re-check the .csproj from one of them and this is when I spotted the problem(s)!

    There are actually 2 problems:

    1. The Microsoft.BCL.Build reference for Nuget does not get remove properly!!

    2. When re-adding Microsoft.BCL.Build Nuget package, it does not set the path correctly in the .csproj

    Below is an example of the fault:

    
    
        
          This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
        
        
        
    
    

    As you can see the first line i.e.

    and kept this one:

    `
                                                            
提交回复
热议问题