[winforms] Subversion에 커밋 한 후 “프로젝트의 종속성을 업데이트 할 수 없습니다”

.NET에 설치 프로젝트가 있습니다. 프로젝트와 다른 프로젝트를 Subversion에 저장하면 설치 프로젝트가 더 이상 컴파일되지 않습니다. “프로젝트의 종속성을 업데이트 할 수 없습니다.”라는 오류가 발생합니다.



답변

MSDN에 이것에 대한 긴 토론 스레드가 있습니다. 가능한 원인이 많은 것 같습니다. 토론에는 Microsoft에서이 문제에 대한 몇 가지 링크가 포함되어 있습니다. 다음은 VS2005 용 핫픽스 와 VS2010 용 해결 방법 입니다.


답변

VS2010을 닫은 다음 다시 열면 항상 나를 위해 일했습니다. 🙂


답변

나는 같은 문제가 있었지만 언급 된 해결책 중 어느 것도 나를 위해 작동하지 않는 것 같습니다. 설정 프로젝트를 재 구축해도 효과가 있지만 30 개가 넘는 프로젝트의 프로젝트 출력을 포함하므로 고통 스럽습니다.

내가 일한 것은 @Marc가 한 것과 매우 유사한 접근 방식입니다.

  1. Visual Studio에서 오류로보고 한 종속성을 확인했습니다.
  2. Notepad ++에서 .vdproj 파일 편집
  3. 문제를 일으키는 .dll을 검색하십시오. “ScatterAssemblies”섹션이 표시됩니다. 비어 있으면 전체 dll 참조를 삭제하십시오.
  4. 파일을 저장

모든 경우에 동일한 dll에 대한 여러 참조가 있습니다 (어떻게 발생했는지 확실하지 않음)

올바른 참조의 예 :

"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_11EC89A306FFB83A269ACC2BF8D8462B"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Some.OrOther.Lib, Version=1.601.4042.16978, Culture=neutral, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                                "_11EC89A306FFB83A269ACC2BF8D8462B"
                                {
                                "Name" = "8:Some.OrOther.Lib.dll"
                                "Attributes" = "3:512"
                                }
                }
"SourcePath" = "8:Some.OrOther.Lib.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_79891234C744498C83755DDEA682F0BF"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}

잘못된 참조의 예 :

"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_11EC89A306FFB83A269ACC2BF8D8462B"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Some.OrOther.Lib, Version=1.601.4042.16978, Culture=neutral, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                }
"SourcePath" = "8:Some.OrOther.Lib.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_79891234C744498C83755DDEA682F0BF"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}

또한 @Marc가 …하지만 설치 프로젝트가 제대로 컴파일되고 실행된다는 동일한 “두 개 이상의 개체가 동일한 대상 위치 ( ‘[targetdir] \ MyAssembly.dll’)를 가지고 있습니다.”라는 경고를 받았습니다.


답변

VS2010 용 핫픽스의 올바른 링크는 다음과 같습니다.

http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30681

설치 후 잘 작동합니다.


답변

나는 비슷한 문제가 있었고 MSDN에 대한 매우 길고 오래된 토론에서 해결책을 찾았습니다 .
사용자 ‘Jeff Hunsaker’가 2010 년 8 월 26 일 목요일 오후 5시 51 분에 답변했습니다 (직접 링크 불가).

Visual Studio 2008 배포 프로젝트를 VS 2010으로 업그레이드 할 때이 문제가 발생했습니다. Hans의 (위) 솔루션이 저에게 효과적이었습니다.

  1. 메모장에서 .vdproj 파일을 편집합니다.
  2. “SourcePath”= “8 :
  3. 각 어셈블리 / dll에 대해 전체 경로를 제공하십시오.
  4. 파일을 저장

내 .vdproj 파일에는 단순히 어셈블리를 참조하는 여러 항목이 있습니다.
“SourcePath”= “8 : MyAssembly.DLL”

Visual Studio가 [어떻게 든] 파일 위치를 알고 있었지만 전체 경로를 제공 할 때까지 “프로젝트의 종속성을 업데이트 할 수 없습니다”오류가 발생했습니다.

“SourcePath”= “8 : .. \ .. \ .. \ build \ bin \ MyCompany.MyAssembly.DLL”

문안 인사,

제프 …

Visual Studio에서보고 한 종속성을 확인하고 필요한 경우 수정하는 스크립트를 작성했습니다.

이제 “두 개 이상의 개체가 동일한 대상 위치 ( ‘[targetdir] \ MyAssembly.dll’)를 가지고 있습니다.하지만 그와 함께 살 수 있습니다.


답변

이것은 나에게 동일한 문제를 해결했습니다. 오류 메시지에 언급 된 어셈블리를 GAC에 추가했습니다. 프로젝트를 다시 컴파일 할 때 dll이 솔루션 탐색기의 “검색된 종속성”아래에 나타나고 동일한 오류가 발생했습니다. 그런 다음 dll을 제외하고 (마우스 오른쪽 버튼을 클릭하고 제외를 선택하십시오) 프로젝트가 마침내 정상적으로 컴파일되었습니다.


답변

.vdproj 파일의 “배포 가능”-> “파일”섹션에있는 고아 파일로 인해 문제가 발생할 수 있습니다. Visual Studio의 설치 프로젝트에서 모든 파일을 제거하여이를 확인할 수 있습니다 (먼저 백업을 만드십시오). 텍스트 편집기로 .vdproj 파일을 열고 “파일”섹션에 항목이 계속 표시되면이 문제가있는 것입니다. 이러한 파일의 키를 확인하고 원본 .vdproj 파일에서 제거하면 다시 작동합니다.

또는이 빠른 수정 프로그램을 컴파일합니다 (Visual Studio 2010에서만 테스트 됨).

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

class Program {
    static void Main(string[] args) {
        try {
            if (args.Length == 0) {
                Console.WriteLine("FixVDProj <path to .vdproj file>");
                return;
            }

            if (!File.Exists(args[0])) {
                throw new Exception("File " + args[0] + " does not exist!");
            }

            string[] strarSource = File.ReadAllLines(args[0]);
            List<string> listDest = new List<string>();
            List<string> listKnownKeys = new List<string>();

            int iSection = 0;
            bool bAccept = true;
            bool bNeedFix = false;

            foreach (string strLine in strarSource) {
                switch (iSection) {
                    case 0:
                        if (strLine.Trim() == "\"DeployProject\"") {
                            listDest.Add(strLine);
                            iSection++;
                        } else {
                            throw new Exception("\"DeployProject\" not found");
                        }
                        break;

                    case 1:
                        if (strLine.Trim() == "\"Hierarchy\"") {
                            iSection++;
                        }
                        listDest.Add(strLine);
                        break;

                    case 2:
                        if (strLine.Trim().StartsWith("\"MsmKey\" = ")) {
                            int p = strLine.IndexOf('=');
                            string strMsm = strLine.Substring(p + 1).Trim();
                            if (strMsm.StartsWith("\"8:") && strMsm.EndsWith("\"")) {
                                listKnownKeys.Add(strMsm.Substring(3, strMsm.Length - 4));
                            } else {
                                throw new Exception("Invalid MsmKey " + strMsm);
                            }
                        } else if (strLine.Trim() == "\"Deployable\"") {
                            iSection++;
                        }
                        listDest.Add(strLine);
                        break;

                    case 3:
                        if (strLine.Trim() == "\"File\"") {
                            iSection++;
                        }
                        listDest.Add(strLine);
                        break;

                    case 4:
                        if (strLine.Trim() == "{") {
                            iSection++;
                        }
                        listDest.Add(strLine);
                        break;

                    case 5:
                        if (strLine.Trim() == "}") {
                            listDest.Add(strLine);
                            iSection = -1;  // finished
                        } else if (strLine.Trim().StartsWith("\"") && strLine.Contains(':')) {
                            int p = strLine.IndexOf(':');
                            string strKey = strLine.Substring(p + 1, strLine.Length - p - 2);
                            if (listKnownKeys.Contains(strKey)) {
                                Console.WriteLine("Accepted key " + strKey);
                                bAccept = true;
                                listDest.Add(strLine);
                            } else {
                                Console.WriteLine("Invalid key " + strKey + " removed");
                                bAccept = false;
                                bNeedFix = true;
                            }
                        } else if (strLine.Trim() == "{") {
                            if (bAccept) {
                                listDest.Add(strLine);
                            }
                            iSection++;
                        } else {
                            listDest.Add(strLine);
                        }
                        break;

                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        if (strLine.Trim() == "{") {
                            iSection++;
                        } else if (strLine.Trim() == "}") {
                            iSection--;
                        }
                        if (bAccept) {
                            listDest.Add(strLine);
                        }
                        break;

                    case 10:
                        throw new Exception("File structure depth exceeded!");

                    default:
                        listDest.Add(strLine);
                        break;
                }
            }

            if (bNeedFix) {
                File.Copy(args[0], args[0] + ".bak", true);
                File.WriteAllLines(args[0], listDest);
                Console.WriteLine("File " + args[0] + " has been fixed!");
            } else {
                Console.WriteLine("File " + args[0] + " did not need fix!");
            }

        } catch (Exception e) {
            Console.WriteLine(e.ToString());
        }
    }
}