为什么dataContextClass的名称会自动更改? [英] why the name of the dataContextClass change automatically?
本文介绍了为什么dataContextClass的名称会自动更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到此错误:
找不到类型或名称空间名称"HwMangementDataContext"(您是否缺少using指令或程序集引用?)
我只是将所有表格的主键设置为onInsert并将此属性添加到一列
DbType ="UniqueIdentifier NOT NULL"
i get this error:
The type or namespace name ''HwMangementDataContext'' could not be found (are you missing a using directive or an assembly reference?)
i just set the primary key of all tabel to onInsert and add this property to one column
DbType = "UniqueIdentifier NOT NULL"
推荐答案
如果手动添加引用后出现相同错误,请尝试以下解决方案:
在项目属性下检查每个项目的构建类型-我敢打赌一个或另一个将针对.NET XX-客户端配置文件进行构建.
对于不一致的版本,尤其是其中一个是Client Profile,而另一个不是,则它在设计时起作用,但在编译时失败.一个真正的陷阱.
对我来说,Visual Studio 2010中发生了一件很有趣的事情,它使项目看似随机地设置为Client Profile,有时是在我创建项目时,有时是在几天后.可能是我不小心点击了某些键盘快捷键.
If you are getting the same error after adding the reference manually, then try the below solution:
Check your build types of each project under project properties - I bet one or the other will be set to build against .NET XX - Client Profile.
With inconsistent versions, specifically with one being Client Profile and the other not, then it works at design time but fails at compile time. A real gotcha.
There is something funny going on in Visual Studio 2010 for me, which keeps setting projects seemingly randomly to Client Profile, sometimes when I create a project, and sometimes a few days later. Probably some keyboard shortcut I''m accidentally hitting.
这篇关于为什么dataContextClass的名称会自动更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文