I ran into an issue with a new Azure Function I created: when I tried to run it, I got an error message about a RunResolvePublishAssemblies
setting.
Digging around the internet did not give an indication where to look. Most examples pointed to years old issues that indicated this message for dotnet core version 1.0. I am running a preview version of 3.0, so that could be the issue.
Testing creating another Function but with Visual Studio did have the same result: the error occurs there as well.
Eventually I grabbed another working project with Azure Functions that we where running for a couple of months and went through all its settings to figure out what the issue could be.
Checked items:
Microsoft.NET.Sdk
host.json
pointed to a correct function host version (2.0
)Eventually I found the culprit! Because the global.json
isn’t present, the dotnet core version wasn’t fixed to any version and that is why it uses a version that doesn’t work.
Add a global.json
file into the root of the project folder with this content, pinning the sdk version to something working for Azure Functions, and build the project again.
{
"sdk": {
"version": "2.1.502"
}
}