{"record":{"id":"8da37fd6be49d3e6","repo":"stride3d/stride","slug":"package-file-filepath-was-not-found","errorCode":null,"errorMessage":"Package file [{filePath}] was not found","messagePattern":"Package file \\[(.+?)\\] was not found","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Package.cs","lineNumber":598,"sourceCode":"    /// </summary>\n    /// <param name=\"log\">The log.</param>\n    /// <param name=\"filePath\">The file path.</param>\n    /// <returns></returns>\n    /// <exception cref=\"System.ArgumentNullException\">\n    /// log\n    /// or\n    /// filePath\n    /// </exception>\n    internal static Package LoadRaw(ILogger log, string filePath)\n    {\n        ArgumentNullException.ThrowIfNull(log);\n        ArgumentNullException.ThrowIfNull(filePath);\n\n        filePath = FileUtility.GetAbsolutePath(filePath);\n\n        if (!File.Exists(filePath))\n        {\n            throw new FileNotFoundException($\"Package file [{filePath}] was not found\");\n        }\n\n        try\n        {\n            var packageFile = new PackageLoadingAssetFile(filePath, Path.GetDirectoryName(filePath)) { CachedFileSize = filePath.Length };\n            var context = new AssetMigrationContext(null, null, filePath, log);\n            AssetMigration.MigrateAssetIfNeeded(context, packageFile, \"Assets\");\n\n            var loadResult = packageFile.AssetContent is not null\n                ? AssetFileSerializer.Load<Package>(new MemoryStream(packageFile.AssetContent), filePath, log)\n                : AssetFileSerializer.Load<Package>(filePath, log);\n            var package = loadResult.Asset;\n            package.FullPath = packageFile.FilePath;\n            // .sdpkg has no serialized name (identity = file name). PackageSession derives this on\n            // session load; do it here too so a direct Package.Load doesn't leave Meta.Name null.\n            if (string.IsNullOrWhiteSpace(package.Meta.Name) && package.FullPath is not null)\n                package.Meta.Name = package.FullPath.GetFileNameWithoutExtension();\n            // A package always carries a version. The session graph-walk overwrites this with the","sourceCodeStart":580,"sourceCodeEnd":616,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Package.cs#L580-L616","documentation":"Thrown by Package.LoadRaw after File.Exists failed: the resolved absolute package file path does not exist on disk, so the raw package cannot be loaded. The faulting input is the filePath argument (or a wrong current directory influencing GetAbsolutePath).","triggerScenarios":"Calling Package.LoadRaw (or dependent load helpers) with a path to a package file that does not exist at the resolved absolute location.","commonSituations":"Typo in package filename; package moved/renamed after a dependency referenced it; working directory different from what a relative path assumed; dependency package not present in a fresh clone.","solutions":["Check File.Exists on the resolved path before loading","Fix the package path or restore the missing .sdpkg file","Convert relative paths against the correct base directory"],"exampleFix":"// before\nvar package = Package.LoadRaw(log, \"assets/Missing.sdpkg\");\n// after\nvar path = FileUtility.GetAbsolutePath(\"assets/Missing.sdpkg\");\nif (!File.Exists(path)) throw new FileNotFoundException(path);\nvar package = Package.LoadRaw(log, path);","handlingStrategy":"validation","validationCode":"var abs = FileUtility.GetAbsolutePath(filePath); if (!File.Exists(abs)) throw new FileNotFoundException(abs);","typeGuard":null,"tryCatchPattern":"try { pkg = Package.LoadRaw(log, filePath); } catch (FileNotFoundException ex) { log.Error($\"Missing package: {ex.Message}\"); }","preventionTips":["Check File.Exists after resolving absolute path","Keep dependent packages with the solution","Fix base directories for relative paths"],"tags":["file-not-found","package","io"],"backgroundTag":"file-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}