{"record":{"id":"eedf8cb43450fdf6","repo":"microsoft/aspire","slug":"resource-resourcenames-0-is-a-dotnetprojectresource","errorCode":null,"errorMessage":"Resource '{resourceNames[0]}' is a DotnetProjectResource. Automatic project publishing for this experimental resource type is not supported. For a C# AppHost project reference, use AddProject<TProject>(...). For a path-based project or file-based app, use AddCSharpApp(...) in C# or addCSharpApp(...) in TypeScript. To publish this resource using explicit container configuration, call PublishAsDockerFile(...) in C# or publishAsDockerFile(...) in TypeScript. If it is intentionally run-only, call ExcludeFromManifest() in C# or excludeFromManifest() in TypeScript.","messagePattern":"Resource '\\{resourceNames\\[0\\]\\}' is a DotnetProjectResource\\. Automatic project publishing for this experimental resource type is not supported\\. For a C# AppHost project reference, use AddProject<TProject>\\(\\.\\.\\.\\)\\. For a path-based project or file-based app, use AddCSharpApp\\(\\.\\.\\.\\) in C# or addCSharpApp\\(\\.\\.\\.\\) in TypeScript\\. To publish this resource using explicit container configuration, call PublishAsDockerFile\\(\\.\\.\\.\\) in C# or publishAsDockerFile\\(\\.\\.\\.\\) in TypeScript\\. If it is intentionally run-only, call ExcludeFromManifest\\(\\) in C# or excludeFromManifest\\(\\) in TypeScript\\.","errorType":"exception","errorClass":"DistributedApplicationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Dotnet/DotnetProjectResource.cs","lineNumber":90,"sourceCode":"        Annotations.Add(new PipelineStepAnnotation(context =>\n        {\n            var unsupportedResources = context.PipelineContext.Model.Resources\n                .OfType<DotnetProjectResource>()\n                .Where(static resource => resource.RequiresPublishValidation())\n                .ToArray();\n\n            if (unsupportedResources.Length == 0 || !ReferenceEquals(context.Resource, unsupportedResources[0]))\n            {\n                return [];\n            }\n\n            return\n            [\n                new PipelineStep\n                {\n                    Name = ValidateDotnetProjectPublishStepName,\n                    Description = \"Validates publish support for .NET project resources.\",\n                    Action = _ => throw new DistributedApplicationException(\n                        GetUnsupportedPublishMessage(unsupportedResources.Select(resource => resource.Name).ToArray())),\n                    Resource = unsupportedResources[0]\n                }\n            ];\n        }));\n\n        // Configuration callbacks run in model order, so later compute-environment callbacks may not have attached\n        // build and push work to publish or deploy yet. Use those steps' stable aggregation roots to add the\n        // validation dependency before any step action can be scheduled.\n        Annotations.Add(new PipelineConfigurationAnnotation(context =>\n        {\n            var validationStep = context.Steps.SingleOrDefault(step =>\n                step.Name == ValidateDotnetProjectPublishStepName &&\n                step.Resource is DotnetProjectResource resource &&\n                resource.RequiresPublishValidation());\n\n            if (validationStep is null)\n            {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Dotnet/DotnetProjectResource.cs#L72-L108","documentation":"Error \"Resource '{resourceNames[0]}' is a DotnetProjectResource. Automatic project publishing for this experimental resource type is not supported. For a C# AppHost project reference, use AddProject<TProject>(...). For a path-based project or file-based app, use AddCSharpApp(...) in C# or addCSharpApp(...) in TypeScript. To publish this resource using explicit container configuration, call PublishAsDockerFile(...) in C# or publishAsDockerFile(...) in TypeScript. If it is intentionally run-only, call ExcludeFromManifest() in C# or excludeFromManifest() in TypeScript.\" thrown in microsoft/aspire.","triggerScenarios":"Thrown at src/Aspire.Hosting.Dotnet/DotnetProjectResource.cs:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use AddProject<TProject>(...) for C# AppHost project references","Use AddCSharpApp(...) (C#) or addCSharpApp(...) (TypeScript) for path-based projects and file-based apps","Call PublishAsDockerFile(...) / publishAsDockerFile(...) to publish with explicit container configuration","Call ExcludeFromManifest() / excludeFromManifest(...) if the resource is intentionally run-only"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}