在 Visual Studio 2013 中,我的项目之一包括:
<ItemGroup>
<Compile Include="Entity\Abstract\Entity.fs" />
<Compile Include="Entity\HumanEntity.fs" />
<Compile Include="State\Abstract\State.fs" />
<Compile Include="State\Abstract\HumanState.fs" />
<Compile Include="State\Human\HumanIdleState.fs" />
<Compile Include="State\Human\HumanAwakenState.fs" />
</ItemGroup>
Visual Studio对此感到窒息,声称:
The project 'Entity.fsproj' could not be opened because opening it would cause a folder to be rendered multiple times in the solution explorer. One such problematic item is 'State\Abstract\State.fs'.
如果我像这样改变包含,一切都很好:
<ItemGroup>
<Compile Include="Entity\AbstractEntity\Entity.fs" />
<Compile Include="Entity\HumanEntity.fs" />
<Compile Include="State\AbstractState\State.fs" />
<Compile Include="State\AbstractState\HumanState.fs" />
<Compile Include="State\Human\HumanIdleState.fs" />
<Compile Include="State\Human\HumanAwakenState.fs" />
</ItemGroup>
这是 VS2013 中的疏忽,还是我在这里做错了什么?
不幸的是,这是 Visual Studio 中 F# 项目系统的限制。更详细的分析可以参见本文 http://marcinjuraszek.com/2014/03/folders-in-f-projects-how-to-do-it-what-to-avoid.html.
即将支持文件夹组织Visual F# 电动工具 http://visualstudiogallery.msdn.microsoft.com/136b942e-9f2c-4c0b-8bac-86d774189cff,我们必须添加验证以防止用户使用菜单项在项目中添加具有重复名称的文件夹(请参阅the code https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharpVSPowerTools.Logic/FolderNameDialog.fs#L28 and 相关讨论 https://github.com/fsprojects/VisualFSharpPowerTools/issues/116)。当然我们不能通过编辑来阻止用户这样做fsproj
files.
也许您可以向 microsoft dot com 的 fsbugs 发送建议,以便可以在即将发布的 Visual F# Tools 版本中修复该问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)