메타 데이터 파일… 프로젝트를 빌드 할 때 오류를 찾을 수 없습니다.
Visual Studio 2008을 시작할 때마다 프로젝트를 처음 실행하려고하면 오류 CS0006 The metadata file ... could not found. 전체 솔루션을 다시 빌드하면 작동합니다.
솔루션에 대한 몇 가지 정보 :
디버그 모드에서 빌드 중이며 Visual Studio가 릴리스 폴더에서 dll : s를 찾지 못한다고 불평합니다.
Visual Studio가 불평하는 프로젝트는 솔루션의 다른 많은 프로젝트에서 사용됩니다.
모든 프로젝트의 기본 출력 경로를 각각 ...... \ build \ debug \ ProjectName 및 ...... \ build \ release \ ProjectName으로 변경했습니다. (단지 하나의 디렉토리에 모든 빌드 파일을 가져 오기 위해)
다른 솔루션과 동일한 문제가 있습니다.
솔루션은 처음부터 만들어졌습니다.
솔루션에는 9 개의 프로젝트가 있습니다. dotnet 3.5를 사용하는 1 개의 WPF 및 8 개의 클래스 라이브러리.
이 문제의 원인에 대한 아이디어가 있습니까?
"메타 데이터를 찾을 수 없습니다"라는 비슷한 문제가 발생했습니다. 솔루션 속성에서 각 프로젝트의 빌드 / 구성 관리자 에 "빌드"확인란이 표시되어 있는지 확인 합니다.
이는 일반적으로 오류를 발생시키는 솔루션과 다른 솔루션에서 참조되는 프로젝트로 인해 발생합니다. 다른 솔루션을 정리하거나 코드를 분기하면이 오류가 나타날 가능성이 큽니다. 해결책은 "메타 데이터를 찾을 수 없음"오류 목록을 아래로 스크롤하고 프로젝트에 대한 참조를 보는 것입니다. 9/10 번,이 솔루션에없는 프로젝트에 대한 끊어진 참조가 표시됩니다. 프로젝트를 추가하여 참조 오류를 수정하고 다시 빌드하십시오. 그것은 그것을 고쳐야합니다.
(나는 오늘 이것을 만났고 과거에 있었고 이것은 항상 작동했습니다)
나는이 문제가 있었지만 도움이되는지 확실하지 않지만 두 가지 다른 솔루션에서 참조하는 동일한 프로젝트의 두 가지 버전이 있기 때문에 발생했습니다. 올바른 프로젝트에 대한 참조를 사용하여 솔루션을 빌드 할 때 두 번째 솔루션이 잘 빌드되지만 첫 번째 솔루션을 정리하고 두 번째 솔루션을 빌드하려고하면 이러한 dll 참조 오류 메시지와 함께 실패합니다.
나를위한 해결책은 실수로 중복 된 동일한 이름을 가진 두 개의 프로젝트가 있다는 것을 알아 내고 이전 잘못된 프로젝트에 대한 참조를 제거하고 새 프로젝트에 대한 참조를 추가하는 것입니다.
어쨌든 이러한 메시지는 약간의 붉은 청어처럼 보입니다. 빌드 출력을 확인하고 빌드에 실패한 첫 번째 프로젝트를 찾고 해당 프로젝트에 대한 참조를 매우 신중하게 확인합니다.
확인해야 할 또 다른 사항은 경로 길이입니다. 이로 인해 메타 데이터 파일을 찾을 수없고 컴파일 오류가 발생합니다. 방금 폴더 이름을 더 짧은 경로와 voilá, 인식되지 않고 검은 색으로 유지되는 클래스로 변경하고 이름 만 변경하면 파란색으로 바뀝니다. 폴더.
저에게는 다른 프로젝트에서 참조 된 프로젝트가있었습니다. 솔루션 탐색기 창의 참조 목록에서 깨진 것으로 표시되지 않았지만 어쨌든 제거하고 읽었습니다. 이제 잘 빌드됩니다!
VS2012에서이 모든 단계를 거쳤지만 솔루션 전체를 빌드 할 때이 문제가 계속 발생했습니다 (개별 프로젝트는 오류없이 잘 빌드되었습니다).
Solution Explorer에서 솔루션을 마우스 오른쪽 버튼으로 클릭하고 "Build Order"를 선택하면 VS가 솔루션을 다시 빌드하는 데 사용하는 순서를 볼 수 있습니다. 엉망진창 일 가능성이 높습니다.
종속성 탭을 클릭하고 솔루션의 다른 프로젝트에 종속 된 프로젝트를 선택하고 종속 된 프로젝트를 확인하여 빌드 순서를 수정할 수 있습니다. 일단 괜찮아지고 솔루션을 다시 빌드하면 시작해야합니다.
내가 과거에 VS2005와 VS2008에서이 문제를 해결 한 방법은 모든 종속성이 정확하고 참조가 dll이 아닌 프로젝트를 가리키는 지 확인하는 것입니다. 그런 다음 각 프로젝트를 진행하여 종속성 순서대로 수동으로 빌드하십시오. 마지막 빌드가 빌드되면 전체 솔루션 빌드를 실행할 수 있습니다.
이 답변은 질문이 15 개월 이상 지난 것을 알고 있으므로 다른 사람들이 나중에 참조 할 수 있도록하기위한 것입니다.
건배
몇 가지 말씀 드리고 싶은 점이 있습니다.
MSBuild에서 빌드 파일로 솔루션 파일을 사용하는 경우 빌드하려는 순서, 즉 프로젝트의 상호 종속성 순서에 따라 프로젝트를 솔루션 파일에 추가해야합니다. 다른 프로젝트가 의존하는 솔루션에 프로젝트가 있지만 참조가 "프로젝트 참조"가 아닌 "참조"로 추가 된 경우 이는 매우 중요합니다.
전염병처럼 피해야하지만 그렇게해야하는 경우에는 적어도 종속 프로젝트가 솔루션 파일의 앞부분에 나타나는지 확인해야합니다.
Visual Studio가 빌드 순서를 생성하는 방식은 MSBuild가 수행하는 방식과 정확히 동일하지 않습니다. 이는 MSBuild가 주로 프로젝트 파일에 의존하여 종속성이 무엇인지 알려주는 반면 Visual Studio는 이러한 종속성을 soltuion 파일에 저장할 수도 있기 때문입니다. 따라서 Visual Studio가 솔루션을 완벽하게 빌드하지만 MSBuild가이를 수행 할 수없는 상황을 볼 수 있습니다.
솔루션 파일에 프로젝트가 표시되는 순서와 솔루션 파일의 웹 사이트 프로젝트에있는 ProjectReferences 요소에 프로젝트가 나열되는 순서를 직접 조정해야하는 몇 가지 경우가 있습니다.
위의 정보가 도움이 되었기를 바랍니다.
예를 들어 LinqtoSQL 데이터 컨텍스트를 사용하고 .designer.cs 파일이 누락 된 경우 메타 데이터 파일을 찾을 수 없음 오류가 발생합니다.
designer.cs 파일을 다시 만드는 것은 쉽습니다.
xml보기를 사용하여 dbml을 엽니 다. 빈 줄을 추가 한 다음 제거하고 저장합니다. 그러면 designer.cs 파일이 다시 생성됩니다.
일부 상황에서 데이터 컨텍스트의 코드 숨김 내에 코드가있는 경우이 해결 방법이 작동하지 않습니다. 이 경우 뒤에있는 코드에서 코드를 꺼내 메모장이나 다른 곳에 넣으십시오. DC에서 라인을 추가 한 다음 제거하고 저장하는 트릭을 수행하십시오. 이제 코드를 다시 넣고 저장하십시오.
SVN에서 프로젝트를 업데이트 할 때마다 비슷한 문제가 발생합니다.
ASP.NET을위한 또 다른 솔루션 :
- IDE를 닫습니다.
- 에서 파일을 삭제합니다
C:\WINDOWS\microsoft.net\framework\v…\Temporary ASP.NET File\
.
나는 또한이 오류가 발생했으며 원인은 프로젝트가 자체를 참조하고 있기 때문입니다. 어떻게 된 건지 모르겠지만 참조를 제거하고 짜잔
먼저 각 프로젝트의 빌드-> 구성 관리자에 "빌드"확인란이 표시되어 있는지 확인합니다.
빌드-> 구성 관리자 메뉴에서 이미 모든 프로젝트를 선택하고 VS 트릭을 다시 시작해도 해당 파일의 참조 (dll 또는 cs 일 수 있음)를 찾아야하는 경우 프로젝트를 수행하고 해당 참조를 수동으로 삭제하십시오. 해당 파일 / 참조는 노란색 아이콘으로 표시되어야합니다. 이 오류는 조사해야 할 솔루션 프로젝트를 확실히 안내합니다.
이 오류의 원인은 Windows 탐색기에서 수동으로 파일을 삭제했고 VS가 참조를 업데이트하지 않았고 더 이상 존재하지 않는 파일을 찾으려고하기 때문입니다!
In my case, I found out that one of my solution was referencing something that wasn't there on the computer (VBIDE). Once i removed the offending reference, the rest of the projects built correctly. Hope that helps someone.
And in another situation, I moved some code from one project to another, and that piece of code was referencing Json.net. I manually added a reference to Json.net but that made the problem come about it. I solved it by installing Json.net through NuGet and that made the problem go away. Hope that helps someone.
Same thing happened. I have several solutions referencing the same library projects (.net 3.5). I noticed when one was built in debug/normal config, and another using some other compiler directive (sqlite/local mode), this would happen. Simply get both projects building with the same directives and you should be fine.
If you've add a new project to the solution, check that this is in the build list (see the Configuration Manager)
I got stuck with the save issue when I wanted to include a dll file generated by Matlab. And I finally solved it by copy a .ctf file, which means certificate I suppose, and a .netmodule, which is needed for proper operation of the .dll, along with the .dll file. And that actually worked! So, my suggestion is to check if the .dll needs any other files to get along with.
Windows 7 Ultimate 32 Visual Studio 2008 SQL Server v2005
I was receiving the same error. And I decided to remove and re-add the project references. I was unable to add them back because the Database reference in each of the referenced projects was blank.
Once I reset the database reference to the correct setting, I was able to build without further issue. Additionally, this was my first attempt to rebuild this project after having branched source code in VSS.
Good Luck
I had this error it was caused by one of my project dependencies where the assembly name had been changed in the project, but the reference was not updated. So updating the reference or renaming the assembly back will fix it.
EE - In My case the problem was in the project which has the Entity framework, open the diagram drag any table 2 cm :) and save, the VS will update all his links to the DB ...build this projects and build the solution, Buildssss.
The only thing that fixed me (because I'm not running VS2010 on an administrator account) is to manually move the environment variable VS120COMNTOOLS from System Variables to User Variables.
Deleting the entries of all source files which are no longer present in the source control and the file system from your .csproj file worked for me.
Detailed approach:
Well, my following answer is not just the summary of all the solutions, but it offers more than that.
Section (1):
In general solutions:
I had 4 errors of this kind (‘metadata file could not be found’) along with 1 error saying 'Source File Could Not Be Opened (‘Unspecified error ‘)'.
I tried to get rid of ‘metadata file could not be found’ error. For that, I read many posts, blogs etc and found these solutions may be effective (summarizing them over here):
Restart VS and try building again.
Go to 'Solution Explorer'. Right click on Solution. Go to Properties. Go to 'Configuration Manager'. Check if the checkboxes under 'Build' are checked or not. If any or all of them are unchecked, then check them and try building again.
If the above solution(s) do not work, then follow sequence mentioned in step 2 above, and even if all the checkboxes are checked, uncheck them, check again and try to build again.
Build Order and Project Dependencies:
Go to 'Solution Explorer'. Right click on Solution. Go to 'Project Dependencies...'. You will see 2 tabs: 'Dependencies' and 'Build Order'. This build order is the one in which solution builds. Check the project dependencies and the build order to verify if some project (say 'project1') which is dependent on other (say 'project2') is trying to build before that one (project2). This might be the cause for the error.
Check the path of the missing .dll:
Check the path of the missing .dll. If the path contains space or any other invalid path character, remove it and try building again.
If this is the cause, then adjust the build order.
Section (2):
My particular case:
I tried all the steps above with various permutations and combinations with restarting VS few times. But, it did not help me.
So, I decided to get rid of other error I was coming across ('Source File Could Not Be Opened (‘Unspecified error ‘)').
I came across a blog: http://www.anujvarma.com/tfs-errorsource-file-could-not-be-opened-unspecified-error/#comment-1539
I tried the steps mentioned in that blog and I got rid of the error 'Source File Could Not Be Opened (‘Unspecified error ‘)' and surprisingly I got rid of other errors (‘metadata file could not be found’) as well.
Section (3):
Moral of the story:
Try all solutions as mentioned in section (1) above (and any other solutions) for getting rid of the error. If nothing works out, as per the blog mentioned in section (2) above, delete the entries of all source files which are no longer present in the source control and the file system from your .csproj file.
'IT story' 카테고리의 다른 글
여러 클래스가있는 요소를 가져 오는 방법 (0) | 2020.08.21 |
---|---|
Web Config Transformation을 사용하여 하위 요소 추가 (0) | 2020.08.21 |
Xcode 디버거 : 변수 값보기 (0) | 2020.08.21 |
유형 검사기가 매우 잘못된 유형 대체를 허용하고 있으며 프로그램은 여전히 컴파일됩니다. (0) | 2020.08.21 |
PHP : 유형 힌트-`Closure`와`Callable`의 차이점 (0) | 2020.08.21 |