Removing document raises below exception #61241
-
I am trying remove a document from workspace but i run into this issue once i call TryApplyChanges on workspace. This is the error message i get System.AggregateException: 'One or more errors occurred. (Cannot modify an evaluated object originating in an imported file "C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.props".)' I saw a similar thread on Stackoverflow but my issue still persists even after trying those changes. Any idea how i can resolve this issue,. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you please use the "report a problem" feature in VS to report this? It should help us get more data on what went wrong. Thanks! |
Beta Was this translation helpful? Give feedback.
-
If ItemGroup for file name is present and EnableDefaultCompileItems set to false, RemoveDocument works fine. e.g. |
Beta Was this translation helpful? Give feedback.
If ItemGroup for file name is present and EnableDefaultCompileItems set to false, RemoveDocument works fine.
e.g.
<ItemGroup> <Compile Include="C:\workdir\Override tests\Configurator\Devspace\DefaultUser\TestModel\Code\Model\XYZ.cs" /> </ItemGroup> <PropertyGroup> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> </PropertyGroup>