Skip to content

Unable to build projects with the latest Sql Server Management Studio installed #282

@corbob

Description

@corbob

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

With the latest Sql Server Management Studio installed, the build attempts to use MSBuild from it and cannot build.

What is Expected?

Build's succeed.

How Did You Get This To Happen?

On the Chocolatey Development VM:

  1. Run choco upgrade sql-server-management-studio
  2. Reboot the VM
  3. Attempt to build chocolatey/choco
  4. Receive build error pointing at the SSMS install directory.

System Details

  • Operating System: Windows 11
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.6.0
  • Chocolatey Licensed Extension version: 7.0.0
  • Chocolatey License type: Business
  • Terminal/Emulator: Windows Terminal

Installed Packages

The main relevant package for this issue is: `sql-server-management-studio 22.0.0`

Output Log

The output of the Build step:

========================================
Build
========================================
Building src/chocolatey.sln
MSBuild version 18.0.2+995a3dce4 for .NET Framework
Build started 12/4/2025 11:43:08 AM.

     1>Project "C:\code\choco\src\chocolatey.sln" on node 1 (Build target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|Any CPU".
       ValidateProjects:
         The project "chocolatey.install" is not selected for building in solution configuration "Release|Any CPU".
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\chocolatey.console\chocolatey.console.csproj" (2) on node 1 (default targets).
     2>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.console\chocolatey.console.csproj]
     2>Done Building Project "C:\code\choco\src\chocolatey.console\chocolatey.console.csproj" (default targets) -- FAILED.
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\chocolatey.tests\chocolatey.tests.csproj" (3) on node 3 (default targets).
     3>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.tests\chocolatey.tests.csproj]
     3>Done Building Project "C:\code\choco\src\chocolatey.tests\chocolatey.tests.csproj" (default targets) -- FAILED.
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\chocolatey\chocolatey.csproj" (4) on node 7 (default targets).
     4>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey\chocolatey.csproj]
     4>Done Building Project "C:\code\choco\src\chocolatey\chocolatey.csproj" (default targets) -- FAILED.
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\chocolatey.tests.integration\chocolatey.tests.integration.csproj" (5) on node 2 (default targets).
     5>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.tests.integration\chocolatey.tests.integration.csproj]
     5>Done Building Project "C:\code\choco\src\chocolatey.tests.integration\chocolatey.tests.integration.csproj" (default targets) -- FAILED.
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\chocolatey.resources\chocolatey.resources.csproj" (6) on node 5 (default targets).
     6>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.resources\chocolatey.resources.csproj]
     6>Done Building Project "C:\code\choco\src\chocolatey.resources\chocolatey.resources.csproj" (default targets) -- FAILED.
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\Chocolatey.PowerShell\Chocolatey.PowerShell.csproj" (7) on node 6 (default targets).
     7>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\Chocolatey.PowerShell\Chocolatey.PowerShell.csproj]
     7>Done Building Project "C:\code\choco\src\Chocolatey.PowerShell\Chocolatey.PowerShell.csproj" (default targets) -- FAILED.
     1>Project "C:\code\choco\src\chocolatey.sln" (1) is building "C:\code\choco\src\chocolatey.benchmark\chocolatey.benchmark.csproj" (8) on node 4 (default targets).
     8>C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\
       Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets"
       , is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.benchmark\chocolatey.benchmark.csproj]
     8>Done Building Project "C:\code\choco\src\chocolatey.benchmark\chocolatey.benchmark.csproj" (default targets) -- FAILED.
     1>Done Building Project "C:\code\choco\src\chocolatey.sln" (Build target(s)) -- FAILED.

Build FAILED.

       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\chocolatey.console\chocolatey.console.csproj" (default target) (2) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.console\chocolatey.console.csproj]


       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\chocolatey.tests\chocolatey.tests.csproj" (default target) (3) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.tests\chocolatey.tests.csproj]


       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\chocolatey\chocolatey.csproj" (default target) (4) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey\chocolatey.csproj]


       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\chocolatey.tests.integration\chocolatey.tests.integration.csproj" (default target) (5) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.tests.integration\chocolatey.tests.integration.csproj]


       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\chocolatey.resources\chocolatey.resources.csproj" (default target) (6) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.resources\chocolatey.resources.csproj]


       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\Chocolatey.PowerShell\Chocolatey.PowerShell.csproj" (default target) (7) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\Chocolatey.PowerShell\Chocolatey.PowerShell.csproj]


       "C:\code\choco\src\chocolatey.sln" (Build target) (1) ->
       "C:\code\choco\src\chocolatey.benchmark\chocolatey.benchmark.csproj" (default target) (8) ->
         C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(340,5): error MSB4019: The imported project "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Rosly
       n\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "$(CSharpCoreTargetsPath)", which evaluated to "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.target
       s", is correct, and that the file exists on disk. [C:\code\choco\src\chocolatey.benchmark\chocolatey.benchmark.csproj]

    0 Warning(s)
    7 Error(s)

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues where something has happened which was not expected or intended.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions