docker學習之路-build asp.net core 2.2產生 warning MSB3245: Could not resolve this reference.錯誤的解決辦法

在docker build的時候有時咱們能夠直接使用dotnet publish來發布,可是若是用docker構建鏡像的時候卻會出現下面的錯誤:node

解決辦法:https://stackoverflow.com/questions/14261412/could-not-resolve-this-reference-could-not-locate-the-assemblydocker

答案的原文以下:You most likely get this message when the project points to an old location of the assembly where it no longer exists. Since you were able to build it once, the assembly has already been copied into your bin\Debug / bin\Release folders so your project can still find a copy.post

If you open the references node of the project in your solution explorer, there should be a yellow icon next to the reference. Remove the reference and add it again from the correct location.ui

If you want to know the location it was referenced from, you'd have to open the .csproj file in a text editor and look for the HintPath for that assembly - the IDE for some reason does not show this information.this

大意就是在.cspj文件中有一個黃線標誌的警告,將那個黃線標誌的警告的行刪除了以後(就是將某一個包引用刪除了),再從新引用一下這個包便可,那我上面貼圖的例子來講,Microsoft.AspNetCOre.Http.Abstractions這個包有問題,因此我就將他刪除了而後從新在nuget下載一下,問題就解決了。code

相關文章
相關標籤/搜索