func start --csharp from Sample doesnt work
See original GitHub issueDescribe the bug
`PS C:\git\semantic-kernel\samples\dotnet\KernelHttpServer> func start --csharp
MSBuild version 17.5.0+6f08c67f3 for .NET C:\git\semantic-kernel\dotnet\Directory.Build.targets : error : Could not resolve SDK “Microsoft.Build.CentralPackageVersions”. Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK. C:\git\semantic-kernel\dotnet\Directory.Build.targets : error : SDK resolver “Microsoft.DotNet.MSBuildWorkloadSdkResolver” returned null. C:\git\semantic-kernel\dotnet\Directory.Build.targets : error : Unable to find package Microsoft.Build.CentralPackageVersions. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages C:\git\semantic-kernel\dotnet\Directory.Build.targets : error : MSB4276: The default SDK resolver failed to resolve SDK “Microsoft.Build.CentralPackageVersions” because directory “C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.Build.CentralPackageVersions\Sdk” did not exist. C:\git\semantic-kernel\dotnet\Directory.Build.targets : error MSB4236: The SDK ‘Microsoft.Build.CentralPackageVersions/2.1.3’ specified could not be found. [C:\git\semantic-kernel\samples\dotnet\KernelHttpServer\KernelHttpServer.csproj]`
Expected behavior Function is started locally
Desktop (please complete the following information):
- OS: Windows 11
- IDE: VS CODE
Issue Analytics
- State:
- Created 6 months ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Do you also have dotnet 6?
There is an unfortunate footnote in that Azure Functions require dotnet 6 to build:
See https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide#supported-versions
Hi @kboro, as the SDK is already installed, can you clear the NuGet cache:
dotnet nuget locals all --clear
Then try to build and run the function again using the following command:
func start --csharp
If the issue persists, you can try to delete the
bin
andobj
folders of the project and rebuild it. Additionally, you can try to update or reinstall the .NET SDK and Visual Studio.