Subversion에 커밋 한 후 "프로젝트의 종속성을 업데이트 할 수 없습니다"
.NET에 설치 프로젝트가 있습니다. 프로젝트와 다른 프로젝트를 Subversion에 저장하면 설치 프로젝트가 더 이상 컴파일되지 않습니다. "프로젝트의 종속성을 업데이트 할 수 없습니다."라는 오류가 발생합니다.
MSDN에 이에 대한 긴 토론 스레드가 있습니다. 가능한 원인이 많은 것 같습니다. 토론에는이 문제에 대한 Microsoft의 몇 가지 링크가 포함되어 있습니다. 다음은 VS2005 용 핫픽스 와 VS2010 용 해결 방법 입니다.
VS2010을 닫은 다음 다시 열면 항상 나를 위해 일했습니다. :)
나는 같은 문제가 있었지만 언급 된 해결책 중 어느 것도 나를 위해 작동하지 않는 것 같습니다. 설정 프로젝트를 재 구축해도 효과가 있지만 30 개 이상의 프로젝트 출력을 포함하기 때문에 고통 스럽습니다.
내가 일한 것은 @Marc가 한 것과 매우 유사한 접근 방식입니다.
- Visual Studio에서 오류로보고 된 종속성을 확인했습니다.
- Notepad ++에서 .vdproj 파일 편집
- 문제를 일으키는 .dll을 검색하십시오. "ScatterAssemblies"섹션이 표시됩니다. 비어 있으면 전체 dll 참조를 삭제하십시오.
- 파일을 저장
모든 경우에 동일한 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 (위)의 솔루션이 저에게 효과적이었습니다.
- 메모장에서 .vdproj 파일을 편집합니다.
- "SourcePath"= "8 :
- 각 어셈블리 / dll에 대해 전체 경로를 제공하십시오.
- 파일을 저장
내 .vdproj 파일에는 단순히 어셈블리를 참조하는 여러 항목이 있습니다.
"SourcePath"= "8 : MyAssembly.DLL"Visual Studio가 [어떻게 든] 파일 위치를 알고 있었지만 전체 경로를 제공 할 때까지 "프로젝트의 종속성을 업데이트 할 수 없습니다"오류가 발생했습니다.
"SourcePath"= "8 : .. \ .. \ .. \ build \ bin \ MyCompany.MyAssembly.DLL"
문안 인사,
제프 ...
Visual Studio에서보고 한 종속성을 확인하고 필요한 경우 수정하는 스크립트를 작성했습니다.
이제 "두 개 이상의 개체가 동일한 대상 위치 ( '[targetdir] \ MyAssembly.dll')를 가지고 있습니다.하지만 그와 함께 살 수 있습니다.
이것은 저에게 동일한 문제를 해결했습니다. 오류 메시지에 언급 된 어셈블리를 GAC에 추가했습니다. 프로젝트를 다시 컴파일 할 때 dll이 솔루션 탐색기의 "Detected Dependencies"아래에 나타나고 동일한 오류가 발생했습니다. 그런 다음 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());
}
}
}
솔루션에서 설치 프로그램 프로젝트를 제거한 다음 기존 프로젝트를 다시 추가하여이 문제를 해결했습니다.
Restarting VS2010 didn't work for me but I managed to get everything working by doing a 'Clean Solution', then a 'Build Solution'. Trying 'Rebuild Solution' after the clean didn't work however. Then I could run the Solution with F5 as normal.
When I get this error I find my VS2010 deployment project (.vdproj) is 'corrupted'. Specifically, items in the FILE section of the VDPROJ file have GUID's that are missing from the HIERARCHY section of the VDPROJ file. This is described in detail below.
1) VS2010 deployment projects include the following sections:
"Hierarchy"
{
}
"Deployable"
{
"File"
{
}
}
2) The HIERARCHY section contains GUIDs for each item (e.g. file) added to the deployment project. In addition, each file added to the project appears as an item under the DEPLOYABLE > FILE section. The following example shows a normal configuration for the file msimg32.dll. Note the matching GUID (i.e. _1C15DB39774F7E79C84F1CC87ECFD60A) in the HIERARCHY and FILE sections.
"Hierarchy"
{
"Entry"
{
"MsmKey" = "8:_1C15DB39774F7E79C84F1CC87ECFD60A"
"OwnerKey" = "8:_0C67A6B6004040DC93A0113E1100615D"
"MsmSig" = "8:_UNDEFINED"
}
}
"Deployable"
{
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1C15DB39774F7E79C84F1CC87ECFD60A"
{
"SourcePath" = "8:MSIMG32.dll"
"TargetName" = "8:MSIMG32.dll"
… more information ...
}
}
}
3) My VS2010 deployment projects can be corrupted in two ways:
a) An item in the FILE section is duplicated and the duplicated item is given a GUID which does not appear in the HIERARCHY section.
b) The GUID associated with an item in the FILE section has been removed from the HIERARCHY section (i.e. the item in the FILE section is orphaned).
3a) Example of first problem - duplicated item in FILE section:
In this example, the file msimg32.dll has two entries in the FILE section. The first (i.e. correct) entry has a matching GUID (i.e. _1C15DB39774F7E79C84F1CC87ECFD60A) in the HIERARCHY section, but the GUID for the second (i.e. error) entry (i.e. 2DDC4FA12BFD46DEAED0053D23331348) does not appear in the HIERARCHY section.
"Hierarchy"
{
"Entry"
{
"MsmKey" = "8:_1C15DB39774F7E79C84F1CC87ECFD60A"
"OwnerKey" = "8:_0C67A6B6004040DC93A0113E1100615D"
"MsmSig" = "8:_UNDEFINED"
}
}
"Deployable"
{
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1C15DB39774F7E79C84F1CC87ECFD60A"
{
"SourcePath" = "8:MSIMG32.dll"
"TargetName" = "8:MSIMG32.dll"
… more information ...
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2DDC4FA12BFD46DEAED0053D23331348"
{
"SourcePath" = "8:MSIMG32.dll"
"TargetName" = "8:MSIMG32.dll"
… more information ...
}
}
}
3b) Example of second problem - orphaned item in the FILE section:
In this example, the file msimg32.dll has an entry in the FILE section. But the GUID associated with this entry (i.e. A515046ADA6244F2A260E67625E4398F) does not have a matching entry in (i.e. it is missing from) the HIERARCHY section.
"Hierarchy"
{
}
"Deployable"
{
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A515046ADA6244F2A260E67625E4398F"
{
"SourcePath" = "8:MSIMG32.dll"
"TargetName" = "8:MSIMG32.dll"
… more information ...
}
}
}
4) Solution: For both problems illustrated above, the solution is to delete the orphaned item in the FILE section.
The following example shows how the FILE section in point 3a above would appear after the second entry for msimg32.dll has been deleted.
"Hierarchy"
{
"Entry"
{
"MsmKey" = "8:_1C15DB39774F7E79C84F1CC87ECFD60A"
"OwnerKey" = "8:_0C67A6B6004040DC93A0113E1100615D"
"MsmSig" = "8:_UNDEFINED"
}
}
"Deployable"
{
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1C15DB39774F7E79C84F1CC87ECFD60A"
{
"SourcePath" = "8:MSIMG32.dll"
"TargetName" = "8:MSIMG32.dll"
… more information ...
}
}
}
5) I found the corrupted entries in the VDPROJ only occurred for:
- a) assembly files (i.e. DLL) from my C# projects and
- b) detected dependencies from my C++ projects (e.g. version.dll, urlmon.dll)
Here are a couple of solutions that work:
1) Removing one of the problem DLLs from the setup project, and then re-adding just that one resolved the problem for me. This worked even when there were many DLLs with the problem. Removing and adding just one of them triggered VS2010 to fix them all up somehow.
2) Rebuild the solution, then try updating the dependencies again. The rebuild helps visual studio discover what the dependencies are, because it may be struggling to find the dependencies with nothing built.
3) Restart Visual Studio
The VS2010 hotfix linked above didn't work for me. Sometimes restarting VS2010 will fix the problem and when that doesn't work, doing the above works.
This can also happen when you are trying to debug and have selected the Release mode. Got me just now :(
I would like to add, that I get the same error when I edit the deployment project from my computer instead of the dedicated compiler computer.
The last time I got that error I needed to roll back the last changes, and re-do it from the dedicated compiler computer.
'developer tip' 카테고리의 다른 글
Bootstrap 4에서 class =“mb-0”은 무엇입니까? (0) | 2020.09.07 |
---|---|
Vim에서 자동 완성 후 미리보기 창을 어떻게 자동으로 제거합니까? (0) | 2020.09.07 |
AWS SNS를 사용한 FCM (0) | 2020.09.07 |
많은 정적 메서드를 사용하는 것이 나쁜가요? (0) | 2020.09.07 |
엔터티 프레임 워크 코드에서 먼저 여러 열에 KeyAttribute를 사용하는 방법 (0) | 2020.09.07 |