{"record":{"id":"7e8841359f46a9bf","repo":"Unity-Technologies/UnityCsReference","slug":"unity-sdk-nuget-feed-not-found-at-sdknugetspath","errorCode":null,"errorMessage":"Unity SDK nuget feed not found at {sdkNugetsPath}","messagePattern":"Unity SDK nuget feed not found at (.+?)","errorType":"exception","errorClass":"DirectoryNotFoundException","httpStatus":null,"severity":"critical","filePath":"Editor/Mono/Scripting/ScriptCompilation/MsBuild/UnityEditorMSBuildPropsTargetsGeneration.cs","lineNumber":236,"sourceCode":"        }\n\n        throw new NotSupportedException($\"Unsupported OS platform {RuntimeInformation.OSDescription}\");\n    }\n\n    private static string s_cachedUnitySdkVersion;\n\n    // Reads the version from Unity.Sdk.<version>.nupkg so global.json tracks CI's bumped value\n    // (in sdk/UnitySdksCommon.props) instead of a hardcoded literal.\n    private static string GetUnitySdkVersion(string sdkNugetsPath)\n    {\n        if (s_cachedUnitySdkVersion != null)\n            return s_cachedUnitySdkVersion;\n\n        const string prefix = \"Unity.Sdk.\";\n        const string suffix = \".nupkg\";\n\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","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Scripting/ScriptCompilation/MsBuild/UnityEditorMSBuildPropsTargetsGeneration.cs#L218-L254","documentation":"Thrown by GetUnitySdkVersion (UnityEditorMSBuildPropsTargetsGeneration.cs:236, DirectoryNotFoundException) when the directory at sdkNugetsPath does not exist. This directory is Unity's bundled local NuGet feed that hosts the Unity.Sdk.<version>.nupkg used to pin the SDK in the generated global.json. A missing feed means the editor install is incomplete or the path resolution pointed at the wrong location.","triggerScenarios":"Generating MSBuild props/targets for script compilation when the bundled SDK nuget feed folder is absent from the editor contents.","commonSituations":"Corrupt or partial Unity Editor install. A custom/non-standard editor layout where the SDK feed lives elsewhere. Files removed by an antivirus or cleanup tool.","solutions":["Reinstall or repair the Unity Editor so the bundled SDK nuget feed directory is present at the expected path.","Verify the editor contents path (EditorApplication.applicationContentsPath) is intact and not partially deleted.","If you relocated editor contents, restore the original layout expected by the version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var sdkNugetsPath = ResolveSdkNugetsPath(); // your path source\nif (!Directory.Exists(sdkNugetsPath))\n    throw new DirectoryNotFoundException(\n        $\"Unity SDK nuget feed missing; reinstall/repair the editor. Expected at {sdkNugetsPath}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the editor install intact; do not delete contents under applicationContentsPath.","Exclude the editor install from aggressive cleanup/antivirus scans.","After any install modification, verify the SDK feed directory exists."],"tags":["unity","msbuild","dotnet","sdk","install","environment"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}