“无解” Visual Studio 中的错误 - 如何连接到 SQL Server 2008 Express?
为了能够使用 Visual Studio 2008 中的内置函数通过 SQL Server 2008 Express 处理 *.mdf
数据库文件,我已经努力了一段时间了。 我在基于 x64 的系统上运行,并且我读到有一个 此设置存在已知问题,但 修补程序 尚未解决我的问题。
基本上,发生的情况是,当我尝试将新的 *.mdf
文件添加到项目的 App_Data
文件夹时,我收到一条错误消息:
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkId=49251
My (unsuccessful)解决此问题的步骤:
- 卸载所有可能与 Visual Studio、SQL Server 或 .NET Framework 相关的程序(这会留下 .NET 2.0 Compact Framework 和 .NET 3.5 Compact Framework,并且未安装任何其他 .NET 相关程序)。
- 重启。
- 通过 Web Platform Installer 2.0(测试版)安装 .NET 3.5 SP1、SQL Server 2008 Express 和 SQL Server Management Studio 2008 Express。
- 重启。
- 从光盘安装 Visual Studio 2008 Professional。
- 重启。
- 安装 Visual Studio 2008 Service Pack 1。
- 重新启动。
- 安装修补程序。
- 重启。
- 启动VS,创建新网站并尝试添加数据库。 仍然收到错误消息...
当我查看“帮助/关于”对话框时,修补程序显示在已应用的更新中。 我还检查并仔细检查了 Visual Studio 中的 SQL Server 实例名称是否设置正确(我从 SSMS 的登录屏幕复制粘贴了实例名称)。
为什么修补程序不能解决我的问题? 我是否以错误的顺序执行操作,或者我是否在某个地方使用了错误的软件版本?
根据知识库文章,问题是 Visual Studio 不正确检测“某些注册表项” - 但没有提及哪些项。 有谁知道如何手动修复这个问题?
哦,是的 - 我见过这个发布。 我知道我可以“降级”到 SQL Server 的 x86 版本,但我真的想让它与 x64 版本一起工作(如果没有别的,只是因为它应该工作......) ,所以这个解决方案并不能真正解决我的问题。 请不要将其作为重复项关闭。
I've been struggling for some time now to be able to use the built-in functions in Visual Studio 2008 to handle *.mdf
database files with SQL Server 2008 Express. I'm running on an x64-based system, and I've read that there is a known problem with this setup, but the hotfix has not solved my problems.
Basically, what happens is that when I try to add a new *.mdf
file to the App_Data
folder of a project, I get an error message saying:
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkId=49251
My (unsuccessful) steps to solve this:
- Uninstall all possible associated programs to Visual Studio, SQL Server or .NET Framework (which left .NET 2.0 Compact Framework and .NET 3.5 Compact Framework, and nothing else .NET related, installed).
- Reboot.
- Install .NET 3.5 SP1, SQL Server 2008 Express and SQL Server Management Studio 2008 Express via the Web Platform Installer 2.0 (Beta).
- Reboot.
- Install Visual Studio 2008 Professional from disc.
- Reboot.
- Install Visual Studio 2008 Service Pack 1.
- Reboot.
- Install hotfix.
- Reboot.
- Start VS, create new Web site and try to add database. Still get the error message...
When I look in the Help/About
dialog, the hotfix shows up among applied updates. I have also checked and double-checked that the SQL Server instance name is correctly set in Visual Studio (I copy-pasted the instance name from the login screen in SSMS).
Why does the hotfix not solve my problems? Am I doing things in the wrong order, or do I have the wrong software versions somewhere?
According to the KB article, the problem is that Visual Studio doesn't correctly detect "some registry keys" - but nothing is said about which keys. Does anyone know how to fix this manually?
Oh, and yes - I've seen this post. I know I could just "downgrade" to the x86 version of SQL Server, but I really want to make this work with the x64 version (if nothing else, just because it's supposed to work...), so that solution doesn't really solve my problems. Please don't close this as a duplicate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的错误,VS 2008 SP 1 on Vista Ultimate 64 位和 SQL 2008 Express 64 位。 下载修补程序并重新启动,启动 SQLEXPRESS,但仍然出现错误。
然后我将空白的“SQL Server 实例名称”(在 VS 2008 -> 工具 -> 选项 -> 数据连接下)更改为“SQLEXPRESS”(与我使用的“.\SQLEXPRESS”相对)在我的 SSMS 下的登录屏幕中。)现在它就像一个魅力!
I had this same error, VS 2008 SP 1 on Vista Ultimate 64 bit with SQL 2008 Express 64 bit. Downloaded the hotfix and rebooted, started up SQLEXPRESS and still got the error.
Then I changed my "SQL Server Instance Name" (under VS 2008 -> Tools -> Options -> Data Connections), which was blank, to "SQLEXPRESS" (versus ".\SQLEXPRESS", which is what I use in my login screen under SSMS.) and now it works like a charm!
尝试更改运行 SQL Server Express 的用户。 这可以在服务管理中更改(按 Win+R,输入 services.msc)。 选择SQL Server Express,右键-> 特性。 “登录”选项卡并选择:“本地系统帐户”,勾选“允许服务与桌面交互” - 这对我有用。
Try changing the user on which the SQL Server Express is running. This can be changed in Services managment (press Win+R, type in services.msc). Choose SQL Server Express, right click -> Properties. 'Log On' tab and select: 'Local System account', tick the 'Allow service to interact with desktop' - this is what worked for me.
我不确定我是否已经解决了这个问题,但我现在已经转移到 Visual Studio 2010(目前是 RC,但当它可用时我将获得完整版本)并且一切工作顺利。
I'm not sure I ever solved this, but I've now moved over to Visual Studio 2010 (RC at the moment, but I'll get the full version when it's availabel) and everything works seemlessly.