VS 2017 Metadata file '.dll could not be found

后端 未结 28 1256
日久生厌
日久生厌 2021-01-31 07:06

I know there is another question with exact the same problem, but I went trough all those answers, and none helped me. :( (This was the question.)

I just created a new A

相关标签:
28条回答
  • 2021-01-31 07:19

    What worked for me:

    Package Manager Console (Visual Studio 2019 Comunity):

    Install-Package NuGet.CommandLine
    nuget locals all -clear
    

    Rebuild solution.

    0 讨论(0)
  • 2021-01-31 07:20

    In my case, I had to open the .csproj file and add the reference by hand, like this (Microsoft.Extensions.Identity.Stores.dll was missing):

    <Reference Include="Microsoft.Extensions.Identity.Stores">
      <HintPath>..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.identity.stores\2.0.1\lib\netstandard2.0\Microsoft.Extensions.Identity.Stores.dll</HintPath>
    </Reference>
    
    0 讨论(0)
  • 2021-01-31 07:23

    Double check the name of your project folder. In my case my project folder was named with spaces in it. When I cloned the project from Team Foundation Server using git bash the spaces in the folder name were converted to: "%20". Changing those back to spaces fixed the problem for me.

    0 讨论(0)
  • 2021-01-31 07:23

    I had the same problem, even with no other errors showing on the "Error List" view after "Rebuild Solution". However, on the "Output" view, I saw the error that was behind the issue:

    The primary reference "C:...\myproj.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.6.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5"

    Once I corrected this, the issue was resolved.

    0 讨论(0)
  • 2021-01-31 07:23

    Check all the projects are loaded. In my case one of the project was unloaded and reloading the project clears the errors.

    0 讨论(0)
  • 2021-01-31 07:24

    I have the same problem, the problem was that solution path have spaces in the name and vs for some reason not resolve the package... download my repository again just renaming the solution with out spaces in the name.

    e.g:

    /Repo/Project Name/src
    

    should be

    /Repo/ProjectName/src
    
    0 讨论(0)
提交回复
热议问题