Error while compiling VSIX project

Deepak Rane (drane) 60 Reputation points
2024-06-12T06:44:57.16+00:00

Hi Team,

I have created on VSIX extension and that worked fine through visual studio on one my machine.But when we tried building the same on different machine we received the following error.

In this I have downgraded the "Microsoft.Visualstudio.SDK" to 15.0.1 version. And I am using Visual studio 2022.

Could you help on this please?

ERROR==>

|Error MSB4226: The imported project "C:\Program Files\Microsoft Visual
Studio\2022\Professional\MSBuild\Microsoft\VisualStudio\v17.0\VSSDK\Microsoft.VsSDK.targets"
was not found. Also, tried to find "VSSDK\Microsoft.VsSDK.targets"
in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v17.0" . These search paths are defined
in "C:\Program Files\Microsoft Visual
Studio\2022\Professional\MSBuild\Current\bin\msbuild.exe.Config".
Confirm that the path in the <Import> declaration is correct, and that
the file exists on disk in one of the search paths.| | -------- | |Error MSB4226: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VisualStudio\v17.0\VSSDK\Microsoft.VsSDK.targets" was not found. Also, tried to find "VSSDK\Microsoft.VsSDK.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v17.0" . These search paths are defined in "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.|

Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
227 questions
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 31,246 Reputation points Microsoft Vendor
    2024-06-12T09:42:00.08+00:00

    Hello @Deepak Rane (drane) ,

    Welcome to Microsoft Q&A forum.

    Is your issue similar to this one?

    I think some components were missing, or the specific version of VSSDK was not set correctly.

    I tested locally but failed to reproduce this issue. Maybe you can try the suggestion mentioned in above thread. Add a property into your project file(.csproj file), like

    <PropertyGroup>    
    	<VisualStudioVersion>17.0</VisualStudioVersion> 
    </PropertyGroup>
    

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.