{"record":{"id":"9a4ca2d7ad35cec2","repo":"dotnet/orleans","slug":"embedded-resource-not-found-fullresourcename","errorCode":null,"errorMessage":"Embedded resource not found: {fullResourceName}","messagePattern":"Embedded resource not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"critical","filePath":"src/Dashboard/Orleans.Dashboard/EmbeddedAssetProvider.cs","lineNumber":99,"sourceCode":"            return false;\n        }\n\n        for (int i = 0; i < acceptEncoding.Count; i++)\n        {\n            var encoding = acceptEncoding[i];\n            if (encoding.Quality is not 0 &&\n                string.Equals(encoding.Value.Value, GZipEncodingValue, StringComparison.OrdinalIgnoreCase))\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    private static ResourceEntry CreateResourceEntry(string fullResourceName)\n    {\n        using var resourceStream = Assembly.GetManifestResourceStream(fullResourceName) ?? throw new FileNotFoundException($\"Embedded resource not found: {fullResourceName}\");\n        using var decompressedContent = new MemoryStream();\n        resourceStream.CopyTo(decompressedContent);\n        var decompressedArray = decompressedContent.ToArray();\n\n        // Compress the content\n        using var compressedContent = new MemoryStream();\n        using (var gzip = new GZipStream(compressedContent, CompressionMode.Compress, leaveOpen: true))\n        {\n            gzip.Write(decompressedArray);\n        }\n\n        // Only use compression if it actually reduces size\n        byte[]? compressedArray = compressedContent.Length < decompressedArray.Length\n            ? compressedContent.ToArray()\n            : null;\n\n        var hash = SHA256.HashData(compressedArray ?? decompressedArray);\n        var eTag = $\"\\\"{Convert.ToBase64String(hash)}\\\"\";","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Dashboard/Orleans.Dashboard/EmbeddedAssetProvider.cs#L81-L117","documentation":"FileNotFoundException (message 'Embedded resource not found') from EmbeddedAssetProvider.CreateResourceEntry when Assembly.GetManifestResourceStream(fullResourceName) returns null. The Orleans Dashboard serves static assets (JS/CSS) from embedded manifest resources; if the resource name does not exactly match an embedded resource, the stream is null and the provider throws. This is built at endpoint-configuration time, so it typically surfaces at app startup.","triggerScenarios":"MapOrleansDashboard resolving a route whose asset name does not match any embedded manifest resource. The default asset set is embedded at build time; a renamed resource, a stripped/incomplete publish, or a mismatched default resource list will trigger it.","commonSituations":"Publishing a trimmed/single-file build that removed embedded resources, a Dashboard package version mismatch (asset list changed but caller references old name), or a custom asset override that did not set BuildAction=EmbeddedResource. Also when the dashboard assembly is referenced via a package but the .csproj did not embed the wwwroot assets.","solutions":["Ensure the Orleans.Dashboard project/package is intact and its assets are marked as EmbeddedResource in the consuming build.","For trimmed/single-file publishes, exclude the dashboard assembly from trimming so embedded resources are preserved.","Verify the resource name casing and full qualification matches what the assembly embeds (use ildasm/reflection to list GetManifestResourceNames())."],"exampleFix":"// before (custom asset not embedded)\nservices.AddDashboard(o => o.AssetOverride = \"MyApp.assets.index.min.js\");\n\n// after\n// .csproj: <ItemGroup><EmbeddedResource Include=\"assets\\index.min.js\" /></ItemGroup>\n// and reference via the correct default name, or confirm with:\nforeach (var n in typeof(DashboardMiddleware).Assembly.GetManifestResourceNames()) Console.WriteLine(n);","handlingStrategy":"validation","validationCode":"var names = typeof(DashboardMiddleware).Assembly.GetManifestResourceNames();\nif (!names.Contains(fullResourceName))\n    throw new FileNotFoundException($\"Missing embedded resource {fullResourceName}. Available: {string.Join(\",\", names)}\");","typeGuard":"static bool ResourceExists(Assembly a, string name) =>\n    a.GetManifestResourceNames().Contains(name);","tryCatchPattern":"try { app.MapOrleansDashboard(); }\ncatch (FileNotFoundException ex) when (ex.Message.Contains(\"Embedded resource not found\"))\n{ logger.LogCritical(ex, \"Dashboard assets missing; check embedding/trimming\"); throw; }","preventionTips":["Mark dashboard assets as EmbeddedResource","Exclude the dashboard assembly from trimming in single-file/published builds","Verify package versions match the expected asset names"],"tags":["dashboard","embedded-resource","deployment","startup"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}