{"record":{"id":"846fe772bd8ad410","repo":"Unity-Technologies/UnityCsReference","slug":"no-prefix-suffix-package-found-in-sdknugetspa","errorCode":null,"errorMessage":"No {prefix}*{suffix} package found in {sdkNugetsPath}","messagePattern":"No (.+?)\\*(.+?) package found in (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"critical","filePath":"Editor/Mono/Scripting/ScriptCompilation/MsBuild/UnityEditorMSBuildPropsTargetsGeneration.cs","lineNumber":252,"sourceCode":"\n        if (!Directory.Exists(sdkNugetsPath))\n            throw new DirectoryNotFoundException($\"Unity SDK nuget feed not found at {sdkNugetsPath}\");\n\n        foreach (var file in Directory.EnumerateFiles(sdkNugetsPath, $\"{prefix}*{suffix}\"))\n        {\n            var name = Path.GetFileName(file);\n            if (name.EndsWith(\".symbols.nupkg\", StringComparison.OrdinalIgnoreCase))\n                continue;\n\n            var candidate = name.Substring(prefix.Length, name.Length - prefix.Length - suffix.Length);\n            if (candidate.Length == 0 || !char.IsDigit(candidate[0]))\n                continue;\n\n            s_cachedUnitySdkVersion = candidate;\n            return candidate;\n        }\n\n        throw new FileNotFoundException($\"No {prefix}*{suffix} package found in {sdkNugetsPath}\");\n    }\n\n    private static string s_cachedDotnetRuntimeVersion;\n\n    // The .NET SDK version written to the generated global.json (sdk.version) must match the .NET SDK\n    // Unity ships. Read it from the SDK's authoritative \".version\" metadata (the version is on the\n    // second line) rather than trusting the folder name, so a .NET upgrade (8 -> 10 -> ...) needs no\n    // change here. We return the full version (e.g. \"10.0.102\"), preserving minor/patch, and pick the\n    // highest if more than one SDK is present.\n    private static string GetDotnetRuntimeVersion()\n    {\n        if (s_cachedDotnetRuntimeVersion != null)\n            return s_cachedDotnetRuntimeVersion;\n\n        var sdkRoot = Path.Combine(EditorApplication.applicationScriptingPath, \"DotNetSdk\", \"sdk\");\n        if (!Directory.Exists(sdkRoot))\n            throw new DirectoryNotFoundException($\"Bundled dotnet SDK not found at {sdkRoot}\");\n","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Scripting/ScriptCompilation/MsBuild/UnityEditorMSBuildPropsTargetsGeneration.cs#L234-L270","documentation":"Thrown by GetUnitySdkVersion (UnityEditorMSBuildPropsTargetsGeneration.cs:252, FileNotFoundException) when the SDK nuget feed directory exists but contains no file matching the Unity.Sdk.*.nupkg pattern. Files ending in .symbols.nupkg are skipped, and candidates whose extracted version does not start with a digit are ignored. If no qualifying package remains, the version cannot be determined and global.json cannot be generated.","triggerScenarios":"The feed directory is present but the Unity.Sdk package is missing, only symbol packages remain, or all candidate package names fail the 'starts with a digit' version check.","commonSituations":"Partial install where the main package was deleted but symbols remain. A repackaged/corrupt SDK feed. A manually modified feed folder.","solutions":["Reinstall/repair the Unity Editor to restore the Unity.Sdk.<version>.nupkg in the bundled feed.","Ensure the package file is named 'Unity.Sdk.<digit-starting-version>.nupkg' (not only a .symbols.nupkg) and was not quarantined by antivirus."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const string prefix = \"Unity.Sdk.\", suffix = \".nupkg\";\nvar pkg = Directory.EnumerateFiles(sdkNugetsPath, $\"{prefix}*{suffix}\")\n    .FirstOrDefault(f => !f.EndsWith(\".symbols.nupkg\", StringComparison.OrdinalIgnoreCase)\n                          && char.IsDigit(Path.GetFileName(f)\n                              .Substring(prefix.Length)[0]));\nif (pkg == null)\n    throw new FileNotFoundException(\n        $\"Unity.Sdk.*.nupkg not found in {sdkNugetsPath}; repair the editor install.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not remove the main Unity.Sdk.<version>.nupkg (leave symbol packages aside).","Ensure antivirus has not quarantined the package.","If you maintain a custom feed, ship a correctly named Unity.Sdk.<digit-version>.nupkg."],"tags":["unity","msbuild","dotnet","sdk","nuget","install","environment"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}