为什么 Visual Studio 启动 localdb,我该如何停止? [英] Why does Visual Studio start localdb and how can I stop that?

查看:43
本文介绍了为什么 Visual Studio 启动 localdb,我该如何停止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试优化我的 Visual Studio 体验和我的机器.我注意到我有两个 SQL Server 实例正在运行,其中一个是 LocalDB.这由 Visual Studio 启动.

I'm trying to optimize my Visual Studio experience and my machine in general. I noticed that I have two instances of SQL Server running, one of which is LocalDB. This gets started by Visual Studio.

我宁愿它根本不启动本地数据库,但我可以想象它将它用于一些事情.因为我已经有一个完整的 sql 实例在运行,所以如果使用它会更好.

I would rather it didnt start local db at all but I can imagine it uses it for a few things. Since I already have a full sql instance running it would be better if it used that.

有谁知道我是否可以阻止它启动或至少在它真正需要它之前不启动它?

Does anyone know if I can stop this from starting or at least not starting it until it really needs it?

推荐答案

以下过程对我有用.

(警告:我根本不使用 LocalDB,所以我不在乎这个过程是否完全禁用它.你可能会有不同的感觉.)

  1. 确保 Visual Studio 没有运行.
  2. 运行 Visual Studio 并转到 SQL Server 对象资源管理器.
  3. 右键单击每个 LocalDB 实例并选择删除,或者如果删除是不可用,请选择断开连接.
  4. 关闭 Visual Studio.
  5. 杀死所有由 Visual Studio 启动的 sqlservr.exe 实例.
  6. 前往HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\SSDT\SqlServerObjectExplorer并验证它没有 ServerInstance 子项,例如 ServerInstance1、ServerInstance2 等.
  7. 重命名 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQLServer Local DB 所以 Visual Studio 找不到它(例如,追加.DISABLED 到键名).
  8. 运行 Visual Studio 并享受无 LocalDB 的体验.
  1. Make sure Visual Studio is not running.
  2. Run Visual Studio and go to the SQL Server Object Explorer.
  3. Right-click each LocalDB instance and choose Delete, or if Delete is unavailable, choose Disconnect.
  4. Close Visual Studio.
  5. Kill all sqlservr.exe instances that were launched by Visual Studio.
  6. Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\SSDT\SqlServerObjectExplorer and verify that it has no ServerInstance subkeys, for example ServerInstance1, ServerInstance2, etc.
  7. Rename HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB so Visual Studio can't find it (for example, append .DISABLED to the key name).
  8. Run Visual Studio and enjoy your LocalDB-free experience.

请注意,每次安装 SQL Server Data Tools (SSDT) 更新时,您都需要重复此过程,因为安装程序会重新添加您重命名的密钥.

Please note that you will need to repeat this procedure every time you install an update to SQL Server Data Tools (SSDT), since the installer re-adds the key you renamed.

这篇关于为什么 Visual Studio 启动 localdb,我该如何停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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