The file could not be added to the project. This file is within the project directory tree error

后端 未结 1 1707
不思量自难忘°
不思量自难忘° 2021-01-11 11:49

Whenever I try to add a file to my Visual Studio project, I get the following warning:

The file [filename] could not be added to the project. This fil

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-11 12:18

    Go in to your Windows File Explorer and navigate to the .csproj file and open it with Notepad (or advanced text editor like NotePad++)

    You will notice two lines that have similar or duplicate Compile Include lines:

    
      "SubDir\MyClass.cs"
    
    

    Remove the Above line and keep only the line similar to the one below:

    
    

    0 讨论(0)
提交回复
热议问题