Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

Failure when .NET global.json doesn't specify SDK version

Open flcdrg opened this issue 4 months ago • 0 comments

Bug Report

  • At what date and time did you most recently experience the problem?

2025-08-16T01:52:48.7879106Z

  • Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.

Azure web apps

  • If your repo is publicly available please share its URL:

https://github.com/flcdrg/azure-appservice-versions

  • What happened?

Deployment failed

  • What did you expect or want to happen?

Deployment and build succeeded

  • How can we reproduce it?

Deploy .NET application with global.json with the following content:

{
  "sdk": {
    "allowPrerelease": false,
    "rollForward": "latestMajor"
  }
}
  • Do you have log output? Please include between the backticks:
Error: Oops... An unexpected error has occurred.\\nError: System.NullReferenceException: Object reference not set to an instance of an object.\\n   at Microsoft.Oryx.BuildScriptGenerator.DotNetCore.SdkVersionInfo.TryParse(String sdkVersion, SdkVersionInfo& result) in /__w/1/s/Oryx/src/BuildScriptGenerator/DotNetCore/SdkVersionInfo.cs:line 45\\n   at Microsoft.Oryx.BuildScriptGenerator.DotNetCore.GlobalJsonSdkResolver.GetSatisfyingSdkVersion(GlobalJsonModel globalJson, IEnumerable`1 availableSdks) in /__w/1/s/Oryx/src/BuildScriptGenerator/DotNetCore/GlobalJsonSdkResolver.cs:line 105\\n   at Microsoft.Oryx.BuildScriptGenerator.DotNetCore.GlobalJsonSdkResolver.GetSatisfyingSdkVersion(ISourceRepo sourceRepo, String runtimeVersion, IEnumerable`1 availableSdks) in /__w/1/s/Oryx/src/BuildScriptGenerator/DotNetCore/GlobalJsonSdkResolver.cs:line 40\\n   at Microsoft.Oryx.BuildScriptGenerator.DotNetCore.DotNetCorePlatform.GetSdkVersion(RepositoryContext context, String runtimeVersion, Dictionary`2 versionMap) in /__w/1/s/Oryx/src/BuildScriptGenerator/DotNetCore/DotnetCorePlatform.cs:line 371\\n   at Microsoft.Oryx.BuildScriptGenerator.DotNetCore.DotNetCorePlatform.ResolveVersions(RepositoryContext context, PlatformDetectorResult detectorResult) in /__w/1/s/Oryx/src/BuildScriptGenerator/DotNetCore/DotnetCorePlatform.cs:line 305\\n   at Microsoft.Oryx.BuildScriptGenerator.DotNetCore.DotNetCorePlatform.Detect(RepositoryContext context) in /__w/1/s/Oryx/src/BuildScriptGenerator/DotNetCore/DotnetCorePlatform.cs:line 101\\n   at Microsoft.Oryx.BuildScriptGenerator.DefaultPlatformsInformationProvider.GetPlatformsInfo(RepositoryContext context) in /__w/1/s/Oryx/src/BuildScriptGenerator/DefaultPlatformsInformationProvider.cs:line 65\\n   at Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator.GenerateBashScript(BuildScriptGeneratorContext context, String& script, List`1 checkerMessageSink) in /__w/1/s/Oryx/src/BuildScriptGenerator/DefaultBuildScriptGenerator.cs:line 75\\n   at Microsoft.Oryx.BuildScriptGeneratorCli.BuildScriptGenerator.TryGenerateScript(String& generatedScript, Exception& exception) in /__w/1/s/Oryx/src/BuildScriptGeneratorCli/BuildScriptGenerator.cs:line 63\\n   at Microsoft.Oryx.BuildScriptGeneratorCli.BuildCommand.Execute(IServiceProvider serviceProvider, IConsole console) in /__w/1/s/Oryx/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs:line 278\\n   at Microsoft.Oryx.BuildScriptGeneratorCli.CommandBase.OnExecute(IConsole console) in /__w/1/s/Oryx/src/BuildScriptGeneratorCli/Commands/CommandBase.cs:line 87\\n/bin/bash -c \"oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform dotnet --platform-version 9.0 -p virtualenv_name= --log-file /tmp/build-debug.log  -i /tmp/8dddc679672f210 | tee /tmp/oryx-build.log ; exit $PIPESTATUS \"

flcdrg avatar Aug 16 '25 02:08 flcdrg