简体   繁体   English

Visual Studio csproj结构-编译元素包含对已删除文件的引用

[英]Visual Studio csproj structure - compile element contains reference to a deleted file

I have deleted a class in my solution. 我已经在解决方案中删除了一个班级。
The csproj file still holds a reference to it. csproj文件仍然包含对其的引用。

as follows 如下

<ItemGroup>
    <Compile.. >
    <Compile Include="MyPath\MyDeletedFile.cs" />
    <Compile.. >
</ItemGroup>

Why wasnt this fle removed? 为什么没有删除该文件?
How do I remove it? 如何删除它? Thanks. 谢谢。

Just delete the line from the csproject file. 只需从csproject文件中删除该行即可。 That should do the magic 那应该做魔术

Right click on Project select "unload project" 右键单击项目,选择“卸载项目”

Right click on Project select "edit" ... hack away... 右键单击项目,选择“编辑” ...入侵...

Right click on Project select "Reload" 右键单击项目,选择“重新加载”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM