programing

VS 2017 메타 데이터 파일 '.dll을 찾을 수 없습니다.

nicescript 2021. 1. 18. 07:39
반응형

VS 2017 메타 데이터 파일 '.dll을 찾을 수 없습니다.


똑같은 문제를 가진 또 다른 질문이 있다는 것을 알고 있지만 모든 답변을 검토했지만 아무도 나를 도왔습니다. :( ( 이것이 질문이었습니다. )

방금 새 ASP.NET MVC 프로젝트를 만들고 솔루션에 '.dll'몇 개를 추가했습니다. 이제 프로젝트를 빌드하려고 할 때 5 개 라이브러리 중 3 개에 아래와 같은 오류 메시지가 표시됩니다.

Error   CS0006  Metadata file 'C:\Users\...\source\Database\bin\Debug\DataAccessLayer.dll' could not be found   Logic   C:\Users\...\source\Logic\CSC   1   Active

Error   CS0006  Metadata file 'C:\Users\...\source\Logic\bin\Debug\Logic.dll' could not be found    PTS2-MVC    C:\Users\...\source\PTS2-MVC\CSC    1   Active

Error   CS0006  Metadata file 'C:\Users\...\source\PTS2-MVC\bin\PTS2-MVC.dll' could not be found    PTS2-MVC.Tests  C:\Users\...\source\PTS2-MVC.Tests\CSC  1   Active

해당 .dll의 bin \ debug 폴더로 이동하면 비어 있고 오류 메시지가 표시되지 않는 다른 .dll이 비어 있지 않음을 알 수 있습니다. 그러나 나는 이것을 고치는 방법이나 이것을 실현하기 위해 내가 한 일을 알지 못합니다.

가장 일반적인 대답은 이동하는 속성솔루션 및 이동 구성선택 해제 > - 적용 -> 확인적용 다시하지만, 작동하지 않았다


문제는 내 프로젝트에 다른 정상적인 오류 메시지가 있었고 분명히 수정 한 후 프로젝트를 다시 정리하고 빌드했을 때 모든 .dll이 성공했다는 것입니다.

프로젝트에 다른 오류 메시지가 없는지 확인하고 있다면 먼저 수정하십시오!


이 오류 수정 단계 : 메타 데이터 파일 .dll을 찾을 수 없습니다.

  1. 모든 프로젝트를 청소하십시오.

  2. 모든 프로젝트를 언로드합니다.

  3. 모든 프로젝트를 다시로드합니다.

  4. ReBuild 솔루션.

그런 다음 문제가 해결되었습니다.


여러 프로젝트가 포함 된 솔루션에서이 문제가 발생했습니다.

.csproj 를 복제 하고 솔루션에 복사본을 추가 한 것입니다. .csproj 파일은 포함 <ProjectGuid>요소를. 복사 한 프로젝트의 GUID를 새 프로젝트로 설정했습니다.

또한 다음 단계를 수행했습니다.

  1. 솔루션 닫기
  2. bin 폴더 삭제
  3. 모든 obj 폴더 삭제
  4. 개방형 솔루션 및 구축

제 경우에는 오류가 있었지만 VS에 의해 제대로 구문 분석되지 않았고 "오류 목록"창에 표시되었습니다. 이를 찾으려면 빌드 창에서 ol "출력"을보고 위에서 아래로 시작하는 메시지를 구문 분석하고 실제 오류를 해결합니다. M $, 고쳐주세요! 이것은 세계 집단 개발자들의 엄청난 시간 낭비입니다.


프로젝트 폴더의 이름을 다시 확인하십시오. 제 경우에는 프로젝트 폴더의 이름이 공백으로 지정되었습니다. git bash를 사용하여 Team Foundation Server에서 프로젝트를 복제 할 때 폴더 이름의 공백이 "% 20"으로 변환되었습니다. 다시 공백으로 변경하면 문제가 해결되었습니다.


이 단계에 따라이 문제를 해결합니다.

  1. 깨끗한 솔루션
  2. Visual Studio 닫기
  3. 프로젝트 디렉토리에서 / bin 삭제
  4. Visual Studio 다시 시작
  5. 솔루션 재 구축

"Rebuild Solution"후 "Error List"보기에 다른 오류가 표시되지 않더라도 동일한 문제가 발생했습니다. 그러나 "출력"보기에서 문제의 원인이되는 오류를 확인했습니다.

기본 참조 "C : ... \ myproj.dll"은 ".NETFramework, Version = v4.6.1"프레임 워크에 대해 빌드 되었기 때문에 확인할 수 없습니다. 현재 대상 프레임 워크 ".NETFramework, Version = v4.5"보다 높은 버전입니다.

이 문제를 수정하면 문제가 해결되었습니다.


나는 같은 문제가 있는데, 문제는 솔루션 경로에 이름에 공백이 있고 어떤 이유로 패키지를 해결하지 못한다는 것입니다. 내 저장소를 다시 다운로드하고 이름에 공백이없는 솔루션의 이름을 바꿉니다.

예 :

/Repo/Project Name/src

해야한다

/Repo/ProjectName/src

나를 위해 청소와 건물이 작동하지 않았습니다. 프로젝트 언로드가 작동하지 않았습니다. Visual Studio 또는 PC를 다시 시작해도 작동하지 않았습니다. 이것이 작동 한 것입니다.

오류를 발생시키는 각 프로젝트로 이동하고 참조에서 문제가있는 프로젝트에 대한 참조를 삭제하고 다시 추가하십시오. 그것은 문제를 해결합니다.

문제는 프로젝트를 이동 (예 : 폴더 내부로 이동) 한 다음이를 참조하는 다른 프로젝트에서 경로가 잘못되어 찾을 수없는 것과 관련된 것 같습니다.


제 경우에는 .csproj 파일을 열고 다음과 같이 참조를 직접 추가해야했습니다 (Microsoft.Extensions.Identity.Stores.dll이 누락되었습니다).

<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>

확인해야 할 또 다른 사항은 호출하는 프로젝트가 동일한 또는 이후 버전의 프레임 워크를 사용하고 있는지 확인하기 위해 참조 된 프로젝트의 대상 프레임 워크입니다.

나는이 문제가 있었고 이전에 제안 된 모든 답변을 시도한 다음 직감으로 프레임 워크를 확인했습니다. 참조 된 프로젝트 중 하나는 호출 프로젝트가 4.5.2 일 때 4.6.1을 대상으로했습니다.


제 경우에는 같은 오류가 발생했습니다. 내 프로젝트 솔루션 중 하나는 다른 NuGet 위치의 어셈블리를 참조했습니다. 이 오류를 해결하고 다시 빌드하기 위해 올바른 위치로 변경했습니다. 프로젝트가 성공적으로 빌드되고 다른 모든 오류가 사라졌습니다.


bash 에서이 명령을 실행하여 모든 bin을 삭제하십시오.

$ find . -iname "bin" -o -iname "obj" | xargs rm -rf

그래도 다른 사람을 위해 작동한다고 보장 할 수는 없습니다.

또한 모든 bin 파일을 삭제하므로 모든 프로젝트를 다시 빌드해야합니다. 사용하기 전에 관련 디렉토리로 이동하는 것이 가장 좋습니다.


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


Close Visual Studio, find the solution's .suo file, delete it, reopen Visual Studio.


Cleaning my solution caused this problem with Visual Studio 2017. Unloading/reloading projects or more cleaning made no difference. Only thing that worked was closing and restarting Visual Studio.


I had this same error. In my case I had built a library (call it commsLibrary) that referenced other libraries by including them as projects in my solution. Later, when I built a project and added my commsLibrary, whenever I would build I got the metadata file cannot be found error. So I added the libraries that my comms library referenced to the current project, then it was able to build.


After facing so many troubles, here is the solution that I found.

  1. open your project folder.
  2. find Your_Project_Name.csproj[Visual C# Project file (.csproj)]
  3. open that file in any text editor and find your missing file ItemGroup.

    <ItemGroup> <None Include="..." /> </ItemGroup>

  4. remove that ItemGroup and open once again your project and build

  5. If that reference is important for you then add once again.

I had the same issue. My problem was someone else on the team moved a class folder, and the project was looking for it.

For me, there were 44 errors; 43 ended in .dll (searching for a dependency) and the first one in the error list ended with .cs (searching for the actual class). I tried clean-build, and clean, unload, reload, build, but nothing working. I ended up locating the class in the project, and just deleted it, as it was showing up as unavailable anyways, followed by a clean-build.

That did the trick for me! Hope this helps.


I had 2 files (and 2 classes) in the same project with the same name.


In my case, I deleted one file directly from team explorer git menu which was causing this problem. When I checked solution explorer it was still showing the deleted file as unreferenced file. When I removed that file from solution explorer, I was able to build project successfully.


For me what worked was:

Uninstall and then reinstall the referenced Nuget package that has the error.


I had the same problem and i tried solutions from Metadata file '.dll' could not be found

but none of these worked.

So after trial and error i fixed it by unloading and reloading the project doing this reset the configuration file and fixed the issue.


In my case I run the tests and got error CS0006. It turned out that I run tests in Release mode. Switch to Debug mode fixed this error.


This issue happens when you renamed your solution and the .net framework cannot find the old solution.

To resolve this, you need to find and replace the old name of solution and all dependencies on it with the new name. If you need to browse the physical file through file explorer do so.

The files that are normally affected are AssemblyInfo.cs, .sln an Properties > Application > Assembly name and Default namespace. Make sure to update them with the new name.

Open the file explorer, if the folder with the old name still exists, you need to delete it. Then clean and build the solution until the error is gone. (If needed clean and build the project one by one especially the affected project.)


What worked for me:

Package Manager Console (Visual Studio 2019 Comunity):

Install-Package NuGet.CommandLine
nuget locals all -clear

Rebuild solution.

ReferenceURL : https://stackoverflow.com/questions/44251030/vs-2017-metadata-file-dll-could-not-be-found

반응형