Microsoft MVP성태의 닷넷 이야기
VS.NET IDE: 165. Visual Studio 2022를 위한 Extension 마이그레이션 [링크 복사], [링크+제목 복사]
조회: 7722
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

Visual Studio 2022를 위한 Extension 마이그레이션

기존 Visual Studio 2019용으로 제작된 확장(Extension) 도구들은 Visual Studio 2022에 설치가 안 됩니다. 가령, 기존 확장 도구의 vsix 파일을 실행해 봐도 그냥 다음과 같이 2022를 찾을 수 없는 것처럼 메시지를 보여주고 종료를 해버립니다.

VSIX Installer
This extension is already installed to all applicable products.

현재의 manifest 파일은 아마도,

<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
  ...[생략]...
  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0,17.0)" />
  </Installation>
  <Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
    <Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" Version="[15.0,)" />
  </Dependencies>
  <Prerequisites>
    <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,)" DisplayName="Visual Studio core editor" />
  </Prerequisites>
  ...[생략]...
</PackageManifest>

[16.0,17.0)으로 상위 버전이 17.0을 포함하지 않는 범위까지 제한이 걸렸을 것입니다. 따라서 다음과 같이 InstallationTarget을 2022를 포함하도록 명시하면 문제가 해결됩니다.

<Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
        <ProductArchitecture>amd64</ProductArchitecture>
    </InstallationTarget>"]"
</Installation>




저렇게 설정했는데 다음과 같은 오류가 발생한다면?

1>VSSDK : error VSSDK1062: Schema validation error for 'C:\...[생략]...\obj\Debug\extension.vsixmanifest'. The 'http://schemas.microsoft.com/developer/vsx-schema/2011:Dependencies' element is not declared.
1>VSSDK : error VSSDK1062: Schema validation error for 'C:\...[생략]...\obj\Debug\extension.vsixmanifest'. The 'http://schemas.microsoft.com/developer/vsx-schema/2011:Assets' element is not declared.

이상하군요, ^^; 혹시나, Dependencies 노드를 주석 처리했더니,

<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
    ...[생략]...
    <Installation>
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
          <ProductArchitecture>amd64</ProductArchitecture>
        </InstallationTarget>
    </Installation>
    <!--Dependencies>
        <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" />
        <Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" Version="[15.0,)" />
    </Dependencies-->
    <Assets>
        <Asset Type="Microsoft.VisualStudio.VsPackage" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
    </Assets>
    ...[생략]...
</PackageManifest>"]]]"

첫 번째 오류는 없어졌습니다. 그렇다면 Assets도 삭제해야 한다는 것인데... 어쩔 수 없군요. ^^; 삭제하고 빌드했는데... 잘 동작합니다. ^^




Visual Studio 2022에서 기존 확장 프로젝트를 빌드하는 경우 다음과 같은 오류가 발생할 수 있습니다.

f:\nuget_root\microsoft.vssdk.buildtools\16.0.298\tools\VSSDK\Microsoft.VsSDK.targets(88,5): error MSB4062: The "CompareBuildTaskVersion" task could not be loaded from the assembly f:\nuget_root\microsoft.vssdk.buildtools\16.0.298\tools\VSSDK\Microsoft.VisualStudio.Sdk.BuildTasks.16.0.dll. Could not load file or assembly 'file:///f:\nuget_root\microsoft.vssdk.buildtools\16.0.298\tools\VSSDK\Microsoft.VisualStudio.Sdk.BuildTasks.16.0.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.


해당 프로젝트에서 Nuget 참조를 하고 있는 Microsoft.VisualStudio.SDK, Microsoft.VSSDK.BuildTools가 너무 구 버전이라 그런 것입니다. 최신 버전으로 업데이트하고 다시 빌드하면 해당 현상은 없어집니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 6/18/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13475정성태12/7/20232279닷넷: 2180. .NET 8 - 함수 포인터에 대한 Reflection 정보 조회파일 다운로드1
13474정성태12/6/20232133개발 환경 구성: 690. 닷넷 코어/5+ 버전의 ilasm/ildasm 실행 파일 구하는 방법 - 두 번째 이야기
13473정성태12/5/20232325닷넷: 2179. C# - 값 형식(Blittable)을 메모리 복사를 이용해 바이트 배열로 직렬화/역직렬화파일 다운로드1
13472정성태12/4/20232155C/C++: 164. Visual C++ - InterlockedCompareExchange128 사용 방법
13471정성태12/4/20232183Copilot - To enable GitHub Copilot, authorize this extension using GitHub's device flow
13470정성태12/2/20232484닷넷: 2178. C# - .NET 8부터 COM Interop에 대한 자동 소스 코드 생성 도입파일 다운로드1
13469정성태12/1/20232193닷넷: 2177. C# - (Interop DLL 없이) CoClass를 이용한 COM 개체 생성 방법파일 다운로드1
13468정성태12/1/20232176닷넷: 2176. C# - .NET Core/5+부터 달라진 RCW(Runtime Callable Wrapper) 대응 방식파일 다운로드1
13467정성태11/30/20232170오류 유형: 882. C# - Unhandled exception. System.Runtime.InteropServices.COMException (0x800080A5)파일 다운로드1
13466정성태11/29/20232376닷넷: 2175. C# - DllImport 메서드의 AOT 지원을 위한 LibraryImport 옵션
13465정성태11/28/20232111개발 환경 구성: 689. MSBuild - CopyToOutputDirectory가 "dotnet publish" 시에는 적용되지 않는 문제파일 다운로드1
13464정성태11/28/20232233닷넷: 2174. C# - .NET 7부터 UnmanagedCallersOnly 함수 export 기능을 AOT 빌드에 통합파일 다운로드1
13463정성태11/27/20232144오류 유형: 881. Visual Studio - NU1605: Warning As Error: Detected package downgrade
13462정성태11/27/20232210오류 유형: 880. Visual Studio - error CS0246: The type or namespace name '...' could not be found
13461정성태11/26/20232258닷넷: 2173. .NET Core 3/5+ 기반의 COM Server를 registry 등록 없이 사용하는 방법파일 다운로드1
13460정성태11/26/20232225닷넷: 2172. .NET 6+ 기반의 COM Server 내에 Type Library를 내장하는 방법파일 다운로드1
13459정성태11/26/20232207닷넷: 2171. .NET Core 3/5+ 기반의 COM Server를 기존의 regasm처럼 등록하는 방법파일 다운로드1
13458정성태11/26/20232212닷넷: 2170. .NET Core/5+ 기반의 COM Server를 tlb 파일을 생성하는 방법(tlbexp)
13457정성태11/25/20232164VS.NET IDE: 187. Visual Studio - 16.9 버전부터 추가된 "Display inline type hints" 옵션
13456정성태11/25/20232459닷넷: 2169. C# - OpenAI를 사용해 PDF 데이터를 대상으로 OpenAI 챗봇 작성 [1]파일 다운로드1
13455정성태11/25/20232339닷넷: 2168. C# - Azure.AI.OpenAI 패키지로 OpenAI 사용파일 다운로드1
13454정성태11/23/20232682닷넷: 2167. C# - Qdrant Vector DB를 이용한 Embedding 벡터 값 보관/조회 (Azure OpenAI) [1]파일 다운로드1
13453정성태11/23/20232218오류 유형: 879. docker desktop 설치 시 "Invalid JSON string. (Exception from HRESULT: 0x83750007)"
13452정성태11/22/20232296닷넷: 2166. C# - Azure OpenAI API를 이용해 사용자가 제공하는 정보를 대상으로 검색하는 방법파일 다운로드1
13451정성태11/21/20232431닷넷: 2165. C# - Azure OpenAI API를 이용해 ChatGPT처럼 동작하는 콘솔 응용 프로그램 제작파일 다운로드1
13450정성태11/21/20232254닷넷: 2164. C# - Octokit을 이용한 GitHub Issue 검색파일 다운로드1
1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...