Checklist
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:
- Run
choco upgrade sql-server-management-studio
- Reboot the VM
- Attempt to build
chocolatey/choco
- 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
Checklist
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:
choco upgrade sql-server-management-studiochocolatey/chocoSystem Details
Installed Packages
Output Log
The output of the Build step:
Additional Context
No response