question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

func start --csharp from Sample doesnt work

See original GitHub issue

Describe 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:closed
  • Created 6 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
craigomaticcommented, Mar 20, 2023

Do you also have dotnet 6?

There is an unfortunate footnote in that Azure Functions require dotnet 6 to build:

image

See https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide#supported-versions

1reaction
eduardogoncalvescommented, Mar 20, 2023

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 and obj folders of the project and rebuild it. Additionally, you can try to update or reinstall the .NET SDK and Visual Studio.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Func start does not work · Issue #2244
I am trying to start functions locally. I have installed the vscode extension - azure functions, azure cli, azure functions core tools.
Read more >
Programmatically starting Function App is failing without ...
Ultimate goal is I want to run a Function App locally for automated testing. I don't know how to do so without using...
Read more >
c# - durable function unable to start
Open the project in Visual Studio 2017. For instructions on how to run the sample, start with Function chaining - Hello sequence sample....
Read more >
Create a C# function from the command line - Azure
In a terminal or command window, run func --version to check that the Azure Functions Core Tools are version 4. · Run dotnet...
Read more >
Guide for running C# Azure Functions in an isolated worker ...
Learn how to use a .NET isolated worker process to run your C# functions in Azure, which supports non-LTS versions of .NET and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found