尝试打开 dbproj 文件时 Visual Studio 出错
我有 Visual Studio 2008 数据库版本,一切都运行良好,直到我第一次尝试加载 .dbproj 文件。这些数据库项目文件适用于与我合作的其他开发人员,但当我尝试打开它时,我只是收到一条错误消息“对象引用设置为对象的实例”。
这可能是同样的问题 这个人正在经历,尽管他没有很好地描述它并且没有解决方案。
所有其他类型的项目文件都会正常加载、构建和运行。 dbproj 文件都会生成这个神秘的错误。我刚刚尝试全新删除并重新安装 Visual Studio 2008 DE,但没有成功。这可能与我安装的 SQL 2005 有关吗? (这也可以通过 SQL Server Management Studio 正常工作。)
** 更新 **
可能更重要的是,当我尝试创建新 dbproj 文件时,会发生同样的错误。所有其他类型的项目都可以毫无问题地创建。
I have Visual Studio 2008 Database Edition, and everything worked great until the first time I tried to load a .dbproj file. These database project files work for the other developers I work with, but when I try to open it, I just get an error message "Object reference ot set to an instance of an object."
It's probably the same problem this guy is having, although he didn't do a good job of describing it and has no solution.
Every other kind of project file loads and builds and runs normally. dbproj files all generate this cryptic error. I just tried a fresh removal and reinstall of Visual Studio 2008 DE to no avail. Could this have something to do with my SQL 2005 installation? (This also works normally through SQL Server Management Studio.)
**
UPDATE
**
Probably even more importantly, this same error occurs when I try to make a new dbproj file. Every other type of project can be created no problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要告诉 Visual Studio 用于验证的正确 SQL Server 实例。
工具>选项>数据库工具
更改“数据连接”和“设计时验证数据库”中的设置以反映正确的实例。
You need to tell Visual Studio the correct instance of SQL Server to use for validation.
Tools>Options>DatabaseTools
Change the settings in "Data Connections" and "Design-time Validation Database" to reflect the correct instance.
经过多次失败的重新配置和重新安装后,我团队的一名成员发现了这个问题!
在工具>下选项>数据库工具>设计时验证数据库,有一个选项可以设置您的 SQL Server 实例名称。 Visual Studio 在安装时会自动选择它。
关键是 Visual Studio 不一定会选择正确的。我的机器上碰巧有 3 个 SQL Server 实例。 SQLEXPRESS(与 Visual Studio 一起安装的 2005 实例)、SQLEXPRESS2005(我安装的 2005 实例)以及 SQLEXPRESS2008(我也安装了)。
Visual Studio 已将自身配置为连接到 SQLEXPRESS2008 实例,尽管它默认情况下仅支持 SQL2005 dbproj 文件。通过打开此对话框并更新服务器实例名称,错误不再出现,并且我能够打开 dbproj 文件:
After many failed re-configurations and re-installations, a member of my team discovered the problem!
Under Tools > Options > Database Tools > Design-time Validation Database, there is an option to set your SQL Server Instance Name. Visual Studio automatically picks this when it's installed.
The key is that Visual Studio doesn't necessarily pick the right one. I happen to have 3 SQL server instances on my machine. SQLEXPRESS (a 2005 instance that Visual Studio installed alongside itself), SQLEXPRESS2005, a 2005 instance I installed, and SQLEXPRESS2008, which I also installed.
Visual Studio had configured itself to connect to the SQLEXPRESS2008 instance, even though it only supports SQL2005 dbproj files by default. By opening this dialogue, and updating the server instance name, the error no longer appeared and I was able to open dbproj files: