在 LightSwitch 上构建失败:"Resource" 参数不支持重复项

build fails on LightSwitch: Duplicate items are not supported by the "Resource" parameter

我一创建新的 LightSwitch 桌面应用程序(不是 HTML)并使用 SQL 服务器中的现有数据库添加数据源,并构建项目失败并显示

The item "......\MyDataSource.csdl" was specified more than once in the "Resources" parameter and both items had the same value "MyDataSource.csdl" for the "LogicalName" metadata. Duplicate items are not supported by the "Resource" paramter unless they have different values for the "LogicalName" metadata.

当我删除 Server 项目中 Data Sources 文件夹下的 MyDataSource 时,解决方案构建成功。一旦我定义了一个新的数据源(指向 SQL 服务器中的任何数据库)并尝试构建解决方案,它就会失败并出现相同的错误。

我没有添加任何屏幕,也没有编辑或添加任何自定义代码,只是创建一个新项目并添加一个数据源,项目构建失败!

我已经看到 this, this, this and this 但没有找到这个问题的正确答案。

我以前遇到过这个问题,但没有找到任何解决方案。但是这次我尽力找出为什么一个简单的 LightSwitch 项目(没有自定义代码,甚至没有屏幕,只添加一个数据源)无法成功构建。

我尝试在不同的目录中使用不同的名称创建新的 LightSwitch 项目,并且通过其中一次尝试,我看到它构建成功!那么有什么区别呢?我以为 Project NameData Source Name 可能有一些东西,但事实并非如此。重点是:

Don't create LightSwitch application in a directory that contains space, The whole directory path containing the LightSwitch project should not contains any space.