Nachdem ich ein Problem mit meiner Installation von Visual Studio 2017 hatte, empfahl mir Microsoft, InstallCleanup.exe -full
auszuführen Dieser Befehl entfernte Visual Studio 2017 und das Visual Studio-Installationsprogramm von meinem Computer, aber dabei brach etwas.Visual Studio 2017 Installer TypeInitializationException
Wenn ich jetzt versuche, Visual Studio 2017 zu installieren, löst das Visual Studio 2017-Installationsprogramm eine TypeInitializationException aus, wenn ich eine Version von Visual Studio zur Installation auswähle.
Die Protokolldatei zeigt die folgende Stack-Trace:
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)]
Leider habe ich es nicht gelungen, dies zu korrigieren. Ich habe das Installationsprogramm erneut heruntergeladen. deinstalliert und entfernt alles in Bezug auf VS2017, neu gestartet, bereinigt den Temp-Ordner. Nichts scheint etwas zu bewirken.
Ich habe Microsoft um Rat gefragt here, aber zwei ähnliche Fehlerberichte here und here bleiben unbeantwortet, so habe ich wenig Hoffnung.
Ich würde den Quellcode für die StringUtility
Klasse betrachten, die das Problem verursacht. Aber ich glaube nicht, dass das Open Source ist. (Ich konnte keine ähnliche Klasse auf referencesource finden). Ich würde auch versuchen, die laufende Anwendung durch Anhängen eines Debuggers zu debuggen, aber leider habe ich kein Visual Studio und kann kein neues installieren :).
Hat jemand eine Ahnung, wie ich versuchen könnte herauszufinden, was diese Ausnahme verursacht? Oder welche Abhängigkeiten könnte ich überprüfen?
Edit: nach der Verwendung von Collect.exe mehr Informationen zu sammeln ich die Innerexception gefunden habe:
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
Sieht aus wie es einige sheneningans mit einem ungültigen Pfad ist? Aber wie werde ich jemals herausfinden welchen Weg :)?