0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

new SqlConnection() で Visual Studio のデバッグ実行がフリーズする

Last updated at Posted at 2022-08-13

現象

Visual Studio でアプリケーションをデバッグ実行中、 SqlConnection のインスタンス化 ( new SqlConnection() ) でフリーズしてしまう現象が発生した。

対処

c# - calling new SqlConnection() hangs program - Stack Overflow
System.Data.SqlClient.SqlConnection のnewでハングする - Qiita

まず上記の記事を参考に、パフォーマンスカウンターのアンロードを試した。

unlodctr ".NET Data Provider for SqlServer"

しかし .NET Data Provider for SqlServer のカウンターはまだインストールされていません というメッセージが表示され、フリーズ現象は解消しなかった。

参考記事のようにカウンターが壊れたのではなく、カウンターが消えている(アンインストール状態になっている)のではないかと想定し、再インストールするために以下のコマンドを実行してみた。

lodctr "C:\Windows\INF\.NET Data Provider for SqlServer\_dataperfcounters_shared12_neutral.ini"

これにより、フリーズ現象が解消した。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?