“ X和X之间的歧义”指的是“ X和X之间的歧义”。修改实体模型后的每个属性 [英] "Ambiguity between X and X" for every property after modifying entity model

查看:85
本文介绍了“ X和X之间的歧义”指的是“ X和X之间的歧义”。修改实体模型后的每个属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我对实体模型中的属性进行的每次更改后,我都对 XYZ.EntityX.PropertyX和 XYZ.EntityX.PropertyX存在歧义,然后尝试重新编译。这两种属性在每种情况下都是相同的。还有很多类型 XYZ.EntityX已经包含 PropertyX的定义。

I'm getting "Ambiguity between 'XYZ.EntityX.PropertyX' and 'XYZ.EntityX.PropertyX'" errors on every reference to properties in my entity model after making a small change to it and attempting to recompile. Both properties are identical in every case. There are also a lot of "The type 'XYZ.EntityX' already contains a definition for 'PropertyX'". Has anyone run into anything like this before?

我最近将代码放到了源代码安全的地方,我会大胆猜测,说可能与此有关。也许它无法更新未检出的文件,并且也不会提示有关文件?我不知道。

I recently put the code into source safe, which I'll take a wild guess and say may have something to do with it. Maybe it cant update a file that's not checked out and also isnt prompting about it? I have no idea.

我所做的只是进入XYZModel.edmx,选择一个表,添加一个标量属性(字符串,50个字符,可为空)并重新编译。直到那时一切都正常。当我从数据库更新模型时,也会发生这种情况。我猜想对模型的任何更改都会导致它。

All I did was go into XYZModel.edmx, select a table, add a scalar property (string, 50 chars, nullable) and recompile. Everything worked until then. It also happens when I 'Update model from database'. I'm guessing any change at all to the model will cause it.

推荐答案

我在Visual Studio 2015中遇到了完全相同的问题但是我使用TFS而不是Sourcesafe。

I had the exact same problem in Visual Studio 2015 but I used TFS instead of Sourcesafe.

第一个选择是确保您已连接到源代码管理(在线)。

First option is to make sure you are connected to your Source Control (Online).

如果这不起作用


  1. 请确保您的Visual Studio解决方案已连接到TFS /源代码管理。当您处于脱机模式时,可能会发生此问题。右键单击该解决方案,如果脱机则选择联机。

  2. 在Visual Studio中联机连接到TFS后,右键单击edmx并选择转到源代码控制->撤消待处理的更改。这将撤消edmx和关联的生成文件的所有未决更改。

  3. 从edmx中删除已更改的表,然后再次添加。

  4. 构建解决方案

  1. Make sure your Visual Studio solution is connected to TFS/Source Control. This issue can occur when your offline mode. Right click on the solution and select Go Online if your offline.
  2. Once your online connected to TFS in Visual Studio right click on the edmx and select Goto Source Control->Undo Pending changes. This will undo all the pending changes for the edmx and the associated generated files.
  3. Delete the changed table from the edmx and add it again.
  4. Build your solution

这篇关于“ X和X之间的歧义”指的是“ X和X之间的歧义”。修改实体模型后的每个属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆