Visual Studio 2017启动崩溃,提示缺失Component.Redgate.SQLPrompt.VsPackage依赖包
Based on your error log, the problem is clear: Visual Studio 2017 Enterprise (version 15.7.27703.2018) can't locate the required Component.Redgate.SQLPrompt.VsPackage,version=9.1.12.5083 dependency. This is a common issue when the SQL Prompt extension becomes corrupted or its installation gets out of sync with Visual Studio. Here are the steps I recommend trying, in order:
First, repair Visual Studio through the Installer
This is the easiest first step, as the installer can automatically detect and restore missing components:- Close all running instances of Visual Studio.
- Launch the Visual Studio Installer (search for it in your Start menu).
- Find your Visual Studio 2017 Enterprise entry, click the More button (three dots), and select Repair.
- Let the repair process run completely—it will scan for missing/corrupted files and replace them, including the missing Redgate package. Restart your machine when prompted.
If repair doesn't work, uninstall and reinstall SQL Prompt
Sometimes the extension itself is the problem. A clean reinstall often resolves dependency mismatches:- If you can't launch Visual Studio normally, try starting it in Safe Mode by running
devenv.exe /safeModefrom an elevated command prompt (this disables all extensions, letting you access the extension manager). - Go to Tools > Extensions and Updates (or Extensions > Manage Extensions depending on your UI setup).
- Locate SQL Prompt in the "Installed" tab, select it, and click Uninstall. Confirm the action and restart Visual Studio.
- Download the latest version of SQL Prompt compatible with Visual Studio 2017, install it, and restart Visual Studio again.
- If you can't launch Visual Studio normally, try starting it in Safe Mode by running
Manually clean up leftover Redgate files (if needed)
If the extension leaves behind corrupted files, manual cleanup might be necessary:- Close Visual Studio entirely.
- Navigate to the system-wide extensions folder:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions - Delete any folders related to Redgate or SQL Prompt (they'll have names like "Redgate.SQLPrompt..." or similar).
- Check your user-specific extensions folder too:
C:\Users\<YourUsername>\AppData\Local\Microsoft\VisualStudio\15.0_<UniqueID>\Extensionsand remove any Redgate-related folders here. - Run the Visual Studio Installer repair again to ensure all dependencies are properly restored.
Use the bootstrapper command for a forced repair
If the standard repair isn't enough, you can run a quiet repair via the command line to target dependency issues:- Grab the Visual Studio 2017 Enterprise bootstrapper (vs_enterprise.exe) if you don't have it saved already.
- Open an elevated command prompt (right-click > Run as Administrator).
- Navigate to the folder containing the bootstrapper and run:
vs_enterprise.exe /repair /quiet /norestart
This will run a repair in the background without user input, which can sometimes fix issues the GUI repair misses.
Error Log for Reference
Here's your error log formatted for readability:
[2544:0006][2018-06-01T11:21:08] Error 0x80131500: 未找到'Microsoft.VisualStudio.Product.Enterprise,version=15.7.27703.2018'的依赖包:Component.Redgate.SQLPrompt.VsPackage,version=9.1.12.5083. at Microsoft.VisualStudio.Setup.Dependencies.DependencyManager.FindDependentPackages(Dependency dependency, DependencyComparer comparer, Dictionary`2 packageIndex, IPackage holder) at Microsoft.VisualStudio.Setup.Dependencies.DependencyManager.BuildGraphRecursive(IPackage graphRoot, DependencyNode node, DependencyComparer comparer, Dictionary`2 packageIndex, Dictionary`2 nodeIndex, Boolean splitNodes) at Microsoft.VisualStudio.Setup.Dependencies.DependencyManager.BuildGraphCore(IPackage root, IEnumerable`1 packages, DependencyComparer comparer, Dictionary`2 packageIndex, Dictionary`2 nodeIndex, Boolean splitNodes, DependencyCollection deprecated) at Microsoft.VisualStudio.Setup.Dependencies.DependencyManager.BuildGraph(IPackage root, IEnumerable`1 packages, Boolean isUpdate, IDependencyComparisonSeed seed, DependencyCollection deprecated) at Microsoft.VisualStudio.Setup.Engine.GetDependencyGraph(Product product) at Microsoft.VisualStudio.Setup.Engine.TryBuildDependencyGraph(Product product, Exception& error, Boolean overwrite, ITelemetryOperation telemetryOperation) [2544:0006][2018-06-01T11:21:08] Error 0x80131500: 未找到'Microsoft.VisualStudio.Product.Enterprise,version=15.7.27703.2018'的依赖包:Component.Redgate.SQLPrompt.VsPackage,version=9.1.12.5083. at Microsoft.VisualStudio.Setup.Engine.CreateInstallOperation(Product product, String destination, ExecuteAction action, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Engine.Repair(CancellationToken token)
内容的提问来源于stack exchange,提问作者Puneet Goel

