Skip to content

MSBuildWorkspace does not support manipulating AdditionalDocuments #51608

@pranavkm

Description

@pranavkm

Version Used: 3.9.0

Steps to Reproduce:

var msw = MSBuildWorkspace.Create();
var project = await msw.OpenProjectAsync("...");
var updated = project.AddAdditionalDocument("Test", SourceText.From("Hello world", Encoding.UTF8));
msw.TryApplyChanges(updated.Project.Solution);

Expected Behavior:
Additional documents are added / changed in the workspace

Actual Behavior:
An exception from Microsoft.CodeAnalysis.Workspace.CheckAllowedProjectChanges(ProjectChanges) that this operation is unsupported.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions