2017-05-25 5 views
1

Visual Studio 2017のインストールに問題が発生した後、マイクロソフトでInstallCleanup.exe -fullを実行するように勧めました。このコマンドは、Visual Studio 2017とVisual Studioインストーラーを削除しましたが、プロセスが途切れました。Visual Studio 2017インストーラーTypeInitializationException

Visual Studio 2017をインストールしようとすると、インストールするVisual Studioのバージョンを選択するたびにVisual Studio 2017インストーラがTypeInitializationExceptionをスローします。

Exception

ログファイルには、次のスタックトレースを示しています

2017-05-25T17:19:18 : Verbose : Getting product. [installerId: SetupEngine, productId: Microsoft.VisualStudio.Product.Community]. 
2017-05-25T17:19:21 : Error : Failed to get product. [installerId: SetupEngine, productId: Microsoft.VisualStudio.Product.Community, error: TypeInitializationException at The type initializer for 'Microsoft.VisualStudio.Setup.Utility.StringUtility' threw an exception. 
    at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceSpecialFolders(String value) 
    at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceVariables(String value, IEnumerable`1 parameters) 
    at Microsoft.VisualStudio.Setup.ProductInstaller.GetSerializableProduct() 
    at Microsoft.VisualStudio.Setup.ProductsProviderService.GetProduct(String channelId, String productId)] 

は、残念ながら、私はこれを修正することはできませんされてきました。インストーラを再ダウンロードしました。アンインストールし、VS2017に関連する何かを削除し、再起動し、一時フォルダをきれいにしました。何の影響もないようです。

私はMicrosoftにガイダンスhereを依頼しましたが、類似の2つのバグレポートherehereは未解決のままですので、ほとんど希望がありません。

私はこの問題の原因と思われるStringUtilityクラスのソースコードを見ていきます。しかし、私はそれがオープンソースだとは思わない。 (私はreferencesourceで同様のクラスを見つけることができませんでした)。私はまた、デバッガを接続して実行中のアプリケーションをデバッグしようとするが、悲しいかな私はVisual Studioがなく、新しいものをインストールすることはできません:)。

誰かがこの例外を引き起こす原因を突き止める方法を知りませんか?または、私が確認できる依存関係は何ですか?

編集:より多くの情報を収集するためにCollect.exeを使用した後、私はのInnerExceptionを見つけた:無効なパスを持ついくつかのsheneningansがあるよう

05/25/2017 17:55:17 : Error : System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.Setup.Utility.StringUtility' threw an exception. ---> System.ArgumentException: Absolute path information is required. 
    at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) 
    at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) 
    at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path) 
    at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks) 
    at Microsoft.VisualStudio.Setup.Utility.StringUtility..cctor() 
    --- End of inner exception stack trace --- 
    at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceSpecialFolders(String value) 
    at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceVariables(String value, IEnumerable`1 parameters) 
    at Microsoft.VisualStudio.Setup.ProductInstaller.GetSerializableProduct() 
    at Microsoft.VisualStudio.Setup.ProductsProviderService.GetProduct(String channelId, String productId)Failed to get a catalog 

が見えますか?しかし、どのように私はこれまでにどのような経路を見つけますか?

答えて

1

検索の別の日の後、私はそれを理解しました。スタックトレースだから、無効なフォルダはWindowsの特殊フォルダの一つであり、このライン

at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks) 

を含ん方法

は注意してください。そのうち少数しかありません。 Powershellスクリプトを使って私はすべての特別なフォルダをテストしました。私は次のpowershellコマンドが非常に似た例外を投げたことに気付きました。それは私が手動でしばらく前にこれを編集していないD:VideosD:\Videos\あるべき\を逃す enter image description here

注:さらに掘り

[environment]::GetFolderPath("MyVideos") 

は、私は、次のレジストリキーを見つけました。パスは、一部のWindows機能では有効であるようです。しかし、.Net関数ではありません。

ライブラリを削除してから、デフォルトに戻しました。 (右クリックして、ライブラリペインのライブラリを削除し、ライブラリアイコンを右クリックし、デフォルトを復元を選択します。)

をリブートした後(動作しなくても)PSスクリプトは、特別なフォルダパスが機能していることを示しました。そしてボイル! Visual Studio Installerもやり直しました:D。

関連する問題