为什么Visual Studio启动localdb,我该如何阻止它?

时间:2022-06-05 02:48:38

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.

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

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.

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

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

有谁知道我是否可以阻止它开始或至少不启动它,直到它真的需要它?

3 个解决方案

#1


8  

The following procedure worked for me.

以下程序对我有用。

(Caveat: I don't use LocalDB at all, so I don't care if this procedure disables it completely. You may feel differently.)

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

  1. Make sure Visual Studio is not running.
  2. 确保Visual Studio未运行。
  3. Run Visual Studio and go to the SQL Server Object Explorer.
  4. 运行Visual Studio并转到SQL Server对象资源管理器。
  5. Right-click each LocalDB instance and choose Delete, or if Delete is unavailable, choose Disconnect.
  6. 右键单击每个LocalDB实例并选择“删除”,如果“删除”不可用,请选择“断开连接”。
  7. Close Visual Studio.
  8. 关闭Visual Studio。
  9. Kill all sqlservr.exe instances that were launched by Visual Studio.
  10. 杀死Visual Studio启动的所有sqlservr.exe实例。
  11. 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.
  12. 转到HKEY_CURRENT_USER \ Software \ Microsoft \ VisualStudio \ 12.0 \ SSDT \ SqlServerObjectExplorer并验证它没有ServerInstance子项,例如ServerInstance1,ServerInstance2等。
  13. 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).
  14. 重命名HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SQL Server本地数据库,以便Visual Studio找不到它(例如,将.DISABLED附加到键名称)。
  15. Run Visual Studio and enjoy your LocalDB-free experience.
  16. 运行Visual Studio并享受您的LocalDB免费体验。

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.

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

#2


3  

LocalDB does not run as a service like SQL Server Express. It will start and stop/automatically as needed.

LocalDB不像SQL Server Express那样运行。它将根据需要自动启动和停止。

LocalDB doesn't create any database services; LocalDB processes are started and stopped automatically when needed. The application is just connecting to "Data Source=(localdb)\v11.0" and LocalDB process is started as a child process of the application. A few minutes after the last connection to this process is closed the process shuts down.

LocalDB不会创建任何数据库服务; LocalDB进程在需要时自动启动和停止。应用程序只是连接到“Data Source =(localdb)\ v11.0”,LocalDB进程作为应用程序的子进程启动。关闭此过程的最后一次连接几分钟后,该过程将关闭。

http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

#3


1  

I have submitted a connect item for this, if you want it to happen vote it up!

我已经为此提交了一个连接项,如果你想让它投票的话!

https://connect.microsoft.com/SQLServer/feedback/details/1694246

https://connect.microsoft.com/SQLServer/feedback/details/1694246

#1


8  

The following procedure worked for me.

以下程序对我有用。

(Caveat: I don't use LocalDB at all, so I don't care if this procedure disables it completely. You may feel differently.)

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

  1. Make sure Visual Studio is not running.
  2. 确保Visual Studio未运行。
  3. Run Visual Studio and go to the SQL Server Object Explorer.
  4. 运行Visual Studio并转到SQL Server对象资源管理器。
  5. Right-click each LocalDB instance and choose Delete, or if Delete is unavailable, choose Disconnect.
  6. 右键单击每个LocalDB实例并选择“删除”,如果“删除”不可用,请选择“断开连接”。
  7. Close Visual Studio.
  8. 关闭Visual Studio。
  9. Kill all sqlservr.exe instances that were launched by Visual Studio.
  10. 杀死Visual Studio启动的所有sqlservr.exe实例。
  11. 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.
  12. 转到HKEY_CURRENT_USER \ Software \ Microsoft \ VisualStudio \ 12.0 \ SSDT \ SqlServerObjectExplorer并验证它没有ServerInstance子项,例如ServerInstance1,ServerInstance2等。
  13. 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).
  14. 重命名HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SQL Server本地数据库,以便Visual Studio找不到它(例如,将.DISABLED附加到键名称)。
  15. Run Visual Studio and enjoy your LocalDB-free experience.
  16. 运行Visual Studio并享受您的LocalDB免费体验。

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.

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

#2


3  

LocalDB does not run as a service like SQL Server Express. It will start and stop/automatically as needed.

LocalDB不像SQL Server Express那样运行。它将根据需要自动启动和停止。

LocalDB doesn't create any database services; LocalDB processes are started and stopped automatically when needed. The application is just connecting to "Data Source=(localdb)\v11.0" and LocalDB process is started as a child process of the application. A few minutes after the last connection to this process is closed the process shuts down.

LocalDB不会创建任何数据库服务; LocalDB进程在需要时自动启动和停止。应用程序只是连接到“Data Source =(localdb)\ v11.0”,LocalDB进程作为应用程序的子进程启动。关闭此过程的最后一次连接几分钟后,该过程将关闭。

http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

#3


1  

I have submitted a connect item for this, if you want it to happen vote it up!

我已经为此提交了一个连接项,如果你想让它投票的话!

https://connect.microsoft.com/SQLServer/feedback/details/1694246

https://connect.microsoft.com/SQLServer/feedback/details/1694246