docker学习之路-build asp.net core 2.2产生 warning MSB3245: Could not resolve this reference.错误的解决办法

在docker build的时候有时我们可以直接使用dotnet publish来发布,但是如果用docker构建镜像的时候却会出现下面的错误:

解决办法:https://stackoverflow.com/questions/14261412/could-not-resolve-this-reference-could-not-locate-the-assembly

答案的原文如下: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.

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.

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.

大意就是在.cspj文件中有一个黄线标志的警告,将那个黄线标志的警告的行删除了之后(就是将某一个包引用删除了),再重新引用一下这个包即可,那我上面贴图的例子来说,Microsoft.AspNetCOre.Http.Abstractions这个包有问题,所以我就将他删除了然后重新在nuget下载一下,问题就解决了。

posted @ 2019-06-25 19:48  wall-ee  阅读(1221)  评论(0编辑  收藏  举报