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?

Visual Studioが起動後にすぐに落ちるようになった場合の対処例

Last updated at Posted at 2024-07-02

はじめに

Visual Studioが起動数秒後に突然落ちるようになった。
これは、試したことと解決したことのログです。

現象

Visual Studioが起動後突然死するようになった。

  • ソリューションファイルやプロジェクトファイルを開くとほぼ確実に落ちる
  • Visual Studioを空で開くと落ちるときもあるけれど、落ちない時もある

試してみたこと

  • ReSharperの起動が遅いせいか?と思い、プラグイン関係をアンインストールしてみるが現象は変わらない
  • Visual Studio Instllerを見るとVersion 17.10.3への更新があったので更新してみたが現象は変わらない

原因と対処

とりあえずログを出してみる。
Visual Studioのインストールディレクトリに移動して、 /log スイッチでログを出してみる。

❯ cd  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE
❯ ./devenv.exe /log C:\temp\vslog.txt

エラーがあった。
image.png

ググってみると類似の事象を発見。
Visual Studio 2022 crashing on startup

下記のディレクトリにあるライセンスのキャッシュ情報が壊れている可能性があるのでリネームしてみろということなのでリネームしてみる。
%LOCALAPPDATA%\Microsoft\VSCommon\OnlineLicensing

無事起動するようになった♡。

壊れたファイル

Answersにもあった通り、何らかの原因でdefault.metadataファイルが破損したことにより、ファイルがNULLで埋められていたのが原因っぽい(左が壊れたファイル)。
image.png

おわりに

何も言わずに落ちると焦る。
よくわからず更新したりすると逆に悪化することもある。まずはログ。

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?