find and solve || findandsolve.com
Please wait.....

CS0006 C# Metadata file could not be found-ASP.NET Core


Error 1 Metadata file

Severity Code Project Description File Line Suppression State

Error CS0006 MalaShree Metadata file 'E:\Project\Provider\bin\Debug\net5.0\ref\Provider.dll' could not be found E:\Project\School\CSC 1 Active

Severity Code Project Description File Line Suppression State

Warning MSB3277 Provider (Provider\Provider) Found conflicts between different versions of "Microsoft.AspNetCore.Http.Features" that could not be resolved.

Answer


Option 1.

You just had the same problem. Visual Studio isn't building the project that's being referenced.

Do Step by Step like as given below.

  1. Right click on the solution and click Properties.
  2. Click Configuration on the left.
  3. Make sure the check box under "Build" for the project it can't find is checked. If it is already checked, uncheck, hit apply and check the boxes again
  4. (Optional) You had to do it for both Release and Debug modes on the solution properties.

Option 2.

Close your Visual Studio and delete the .suo file that is next to the .sln file. (It will be re-generated the next time you Save all (or exit Visual Studio)).

Option 3.

 You must manually build the dll project by right clicking on your solution and click on build solution.

Targeting a slightly different version of .NET and this was flagged as a warning by the compiler, but it was causing building to fail. This should have been flagged as an error and not a warning.

Option 4.

In the Visual Studio 2019 this is also working fine like as given below step.

  1. Close Visual Studio
  2. Delete the hidden .vs folder
  3. Reopen Visual Studio and rebuild the solution.

Option 5.

install-package entityframework -version 6.0.0.0

The error was still showing like as given above , so  that those references were there because there was an older version of Entity Framework supposedly "preinstalled" on the project, but it was not really working.

The file packages.config and noticed that there was another reference:

<packages>
  **<package id="EntityFramework" version="5.0.0" targetFramework="net45" />**
  <package id="EntityFramework" version="6.0.0" targetFramework="net45" />
</packages>

After that  deleted the line, cleaned and rebuild the project and the container solution, and it finally worked.

Option 6.

If your solution path is something like "My Project%2c Very Popular%2c Unit Testing%2c Software and Hardware.zip", it cannot resolve the metadata file, perhaps we should prevent some invalid words like %2c.

Option 7.

In some case this is working fine in VS2019 .Net Core,.net 5, ASP.Net Core solution.

  1. Open a PowerShell console in the same location of the solution.
  2. Type dotnet restore to restore al packages and projects
  3. Type dotnet build. The solution will be built


Related information

Sundar  Neupane

Sundar Neupane

I like working on projects with a team that cares about creating beautiful and usable interfaces.

If findandsolve.com felt valuable to you, feel free to share it.

Comments



Report Response