Error VSSDK1311 about ProductArchitecture when building extension for VS2022
Asked Answered
P

2

8

I'm building a VSIX project and seeing this error message:

VSSDK1311 The vsixmanifest must contain a value for 'PackageManifest:Installation:InstallTarget:ProductArchitecture'.

What do I need to do to fix this?

Pinchpenny answered 31/5, 2021 at 7:22 Comment(0)
P
17

Since VS2022 is 64-bit, you must specify the architecture of the target you support.

Where you previously may have written:

  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[16.0,17.0)" />
  </Installation>

You would now write:

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

If your VSIX is configured to target VS2022 as well as earlier versions you may specify that with something resembling:

  <Installation>
    <InstallationTarget Version="[16.0,18.0)" Id="Microsoft.VisualStudio.Pro">
      <ProductArchitecture>x86</ProductArchitecture>
    </InstallationTarget>
    <InstallationTarget Version="[17.0,18.0)" Id="Microsoft.VisualStudio.Pro">
      <ProductArchitecture>amd64</ProductArchitecture>
    </InstallationTarget>
  </Installation>
Pinchpenny answered 31/5, 2021 at 7:22 Comment(2)
Did you get any errors like the following after adding '<ProductArchitecture>' 1. The element 'PackageManifest' in namespace 'schemas.microsoft.com/developer/vsx-schema/2011' has invalid child element 'InstallationTarget' in namespace 'schemas.microsoft.com/developer/vsx-schema/2011'. 2. There was a problem validating the xml schema. The 'schemas.microsoft.com/developer/vsx-schema/…' element is not declared.Dori
I would check the xmlns in your manifest file against one from a template. Sounds like it might be outdated.Pinchpenny
S
2

I tried your way and got a few errors. I found a way to fix it. Because ProductArchitecture is a new metadata that was introduced in VS2022. Using 16.x versions of the build tools will not recognize it. You should be using the latest 17.x version of the build tools https://www.nuget.org/packages/Microsoft.VSSDK.BuildTools/17.0.3177-preview3

Sidonius answered 16/3, 2023 at 1:53 Comment(1)
That's a good point to call out, thanks. You must use version 17 to build for VS 2022 (which itself is VS version 17).Pinchpenny

© 2022 - 2024 — McMap. All rights reserved.