Search code examples
visual-studio

Cannot modify an evaluated object originating in an imported file


I am trying to delete a file from my visual studio project, but this dialogue pops up and prevent me from doing that. What does it mean and how do I resolve this problem?

There is a xamarin thread about this but no solution there.

https://forums.xamarin.com/discussion/25719/cannot-modify-an-evaluated-object-originating-in-an-imported-file

enter image description here


Solution

  • We have no idea what the real problem is, but we do find a fix by comparing this project with some other project files that we have.

    The fix is to open the .Shared.vcxitems file in an text editor and replace this:

      <ItemGroup>
        <ProjectCapability Include="$(MSBuildThisFileDirectory)SourceItemsFromImports" />
      </ItemGroup>
    

    with this

      <ItemGroup>
        <ProjectCapability Include="SourceItemsFromImports" />
      </ItemGroup>