Could not resolve this reference. Could not locate the assembly

Everytime I build my solution, I get this error message:

Warning

3

Could not resolve this reference. Could not locate the assembly "StandardClassLibrary, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

StandardClassLibrary

So my application has a number of projects of which StandardClassLibrary is one. The above message is a warning and as far as I can tell it does NOT have an impact on my solution.

But I would rather it not be there, just in case...


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.


If anyone face this issue with some nuget packages, you can fix that by reinstalling the packages using the Package Manager Console:

Update-Package -reinstall 

If you have built an image with Docker, and you're getting these strange messages:

warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Configuration.Abstractions". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/src/Utilities/Utilities.csproj]

Open the affected projectUtilities/Utilities.csproj, (You shall look for your project). You may need to choose Unload Project from the menu first. Right click on the .csproj file and edit it.

Now, delete all the <HintPath> tags

Save, and try again.

enter image description here

enter image description here