You can either remove these items from your project file, or set the ‘EnableDefaultCompileItems’ property to ‘false’ if you want to explicitly include them in your project file.Īfter the IDE makes the change, I start getting the error message, along with all kinds of ‘unambiguous reference’ errors throughout my code. NET SDK includes ‘Compile’ items from your project directory by default. My file was unsaved and I attempted to rename the file in the IDE to the name of one of the classes.ĭuplicate ‘Compile’ items were included. None of the classes assumed the name of the file.
In my case, I had a file that contained a couple of classes that I intended to break out into separate files. I’m not sure what series of events led you to getting this error message, but for my project it happened when I was renaming a file in Visual Studio 2017.
Thankfully, fixing this is pretty straightforward. This is an error I’ve gotten a few times lately in Visual Studio 2017 after renaming a file:ĭuplicate ‘Compile’ items were included.