Skip to content

Visual Studio hangs when opening solution #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gfody opened this issue Mar 12, 2025 · 6 comments
Open

Visual Studio hangs when opening solution #587

gfody opened this issue Mar 12, 2025 · 6 comments
Labels
area: ssdt Related to the use of DacFx in Visual Studio (SSDT) bug Something isn't working

Comments

@gfody
Copy link

gfody commented Mar 12, 2025

  • SqlPackage or DacFx Version: N/A
  • .NET Framework (Windows-only) or .NET Core: 9.0.201
  • Environment (local platform and source/target platforms): Windows x64

Steps to Reproduce:

  1. clone my minimal repro https://github.com/gfody/SqlClrTest
  2. open the solution, VS hangs forever on "Preparing Solution..."

Image

if I check the "Do not load projects" box and open the solution and then load all projects there is no hang.

I captured this log while it hung: vs.log

copy info: about.txt

@gfody gfody added the bug Something isn't working label Mar 12, 2025
@gfody
Copy link
Author

gfody commented Mar 12, 2025

tested on 17.14.0 Preview 2.0 and it also hangs

fwiw if I install SQL Server Data Tools SDK-Style (Preview) and change the project type guid from {00D1A9C2-B5F0-4AF3-8072-F6C62B433612} to {42EA0DBD-9CF1-443E-919E-BE9C484E4577} then it no longer hangs

@dzsquared dzsquared added the area: ssdt Related to the use of DacFx in Visual Studio (SSDT) label Mar 12, 2025
@gfody
Copy link
Author

gfody commented Mar 12, 2025

got a stack trace

[Waiting on Async Operation, double-click or press enter to view Async Call Stacks]
[External Code]
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.ExecuteSynchronously<Microsoft.VisualStudio.ProjectSystem.VS.HResult>(System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.HResult>> asyncAction) Line 152
	at Microsoft.VisualStudio.ProjectSystem\ProjectMultiThreadedService.cs(152)
Microsoft.VisualStudio.ProjectSystem.VS.dll!Microsoft.VisualStudio.ProjectSystem.VS.HResult.InvokeWithArg<(Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode, System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.HResult>>)>(System.Func<(Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode, System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.HResult>>), Microsoft.VisualStudio.ProjectSystem.VS.HResult> action, (Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode, System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.HResult>>) arg, System.IServiceProvider vsShellServiceProvider, Microsoft.VisualStudio.ProjectSystem.IProjectFaultHandlerService projectFaultHandlerService, Microsoft.VisualStudio.ProjectSystem.UnconfiguredProject project)
Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.HrInvoke(System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.HResult>> asyncAction, bool registerProjectFaultHandlerService)
Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.VsOutputGroupBase.get_Outputs(uint celt, Microsoft.VisualStudio.Shell.Interop.IVsOutput2[] rgpcfg, uint[] pcActual)
Microsoft.VisualStudio.Data.Tools.Package.dll!Microsoft.VisualStudio.Data.Tools.Package.Project.DatabaseProjectNode.GetOutputByExtension(Microsoft.VisualStudio.Shell.Interop.IVsOutputGroup builtOutputGroup, string fileExtension)
Microsoft.VisualStudio.Data.Tools.Package.dll!Microsoft.VisualStudio.Data.Tools.Package.Project.DatabaseProjectNode.GetProjectOutputPath(Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hierarchy, bool modelOutput)
Microsoft.VisualStudio.Data.Tools.Package.dll!Microsoft.VisualStudio.Data.Tools.Package.Project.Internal.ProjectReferenceNode.ReferencedFileNameFullPath.get()
Microsoft.VisualStudio.Data.Tools.Package.dll!Microsoft.VisualStudio.Data.Tools.Package.Project.Features.FileManagerFeature.ProjectReferenceListener.UnlistenToReference(Microsoft.VisualStudio.Data.Tools.Package.Project.IDatabaseReferenceNode refNode)
Microsoft.VisualStudio.Data.Tools.Package.dll!Microsoft.VisualStudio.Data.Tools.Package.Project.Features.FileManagerFeature.ProjectReferenceListener..ctor.AnonymousMethod__3_0(Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hier)
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.BuildManager.SolutionBuildManager.NotifyOnActiveProjectCfgChange.AnonymousMethod__309_0(uint cookie, Microsoft.VisualStudio.CommonIDE.Solutions.BuildManager.SolutionBuildManager.SolutionUpdateEventsSink sink, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy vshierarchy)
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.Internal.VisualStudio.PlatformUI.CookieTable<uint, Microsoft.VisualStudio.CommonIDE.Solutions.BuildManager.SolutionBuildManager.SolutionUpdateEventsSink>.ForEach<Microsoft.VisualStudio.Shell.Interop.IVsHierarchy>(System.Action<uint, Microsoft.VisualStudio.CommonIDE.Solutions.BuildManager.SolutionBuildManager.SolutionUpdateEventsSink, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy> callback, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy state, bool skipRemoved)
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.BuildManager.SolutionBuildManager.NotifyOnActiveProjectCfgChange(Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pIVsHierarchy)
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Configurations.SolutionConfigurationManager.NotifyCfgChanged(bool firePrefetchEvents)
[External Code]
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Configurations.SolutionConfigurationManager.Notify(Microsoft.VisualStudio.CommonIDE.Solutions.Interop.ConfigurationManagerInternalMessage eMessage)
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Solution.NotifyOnAfterOpenSolutionAsync(bool fNewSolution, bool bInitDefaultCfgs)
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Solution.OpenAsync(bool firstPass, string solutionFilename, Microsoft.VisualStudio.Shell.Interop.__VSSLNOPENOPTIONS grfOpenOpts, string seekProjectFile, bool supressUi, System.Threading.CancellationToken cancellationToken)
[Resuming Async Method]
[External Code]
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Solution.Open(string lpszSolutionFilename, Microsoft.VisualStudio.Shell.Interop.__VSSLNOPENOPTIONS grfOpenOpts, string lpszSeekProjectFile)
Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Solution.Microsoft.Internal.VisualStudio.Shell.ProjectSystem.IVsAsyncSolutionService.OpenSolutionAsync(string path, System.Threading.CancellationToken cancellationToken)
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.Packages.MRU.ExtensionMethods.TryOpenProjectAsync(Microsoft.VisualStudio.Shell.Interop.IVsSolution solution, string projectPath, System.Guid projectGuid, System.Threading.CancellationToken cancellationToken)
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.CodeContainerAccessManager.OpenLocalCodeContainerAsync(Microsoft.VisualStudio.Shell.CodeContainerManagement.CodeContainer codeContainer)
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.CodeContainerAccessManager.OpenAsync(Microsoft.VisualStudio.Shell.CodeContainerManagement.CodeContainer codeContainer)
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.CodeContainerListViewModel.OpenCodeContainerAsync(Microsoft.VisualStudio.PlatformUI.CodeContainerViewModelBase codeContainerViewModel)
[External Code]
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.CodeContainerListViewModel.OnOpenCore(Microsoft.VisualStudio.PlatformUI.CodeContainerViewModelBase codeContainerViewModel)
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.MRUItemsMenuCommand.OnInvokedDynamicItem.AnonymousMethod__0()
[External Code]
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.MRUItemsMenuCommand.OnInvokedDynamicItem(object sender, System.EventArgs args)
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.VisualStudio.Shell.OleMenuCommand.Invoke(object inArg, System.IntPtr outArg, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT options)
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.VisualStudio.Shell.OleMenuCommandService.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec(ref System.Guid commandGroup, uint nCmdId, uint nCmdExcept, System.IntPtr pIn, System.IntPtr vOut)
[External Code]
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.VsCommand.Execute(object parameter)
[External Code]
[Async Call Stack]
[Async] Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.Solutions.Solution.OpenAsync(string lpszSolutionFilename, Microsoft.VisualStudio.Shell.Interop.__VSSLNOPENOPTIONS grfOpenOpts, string lpszSeekProjectFile, System.Threading.CancellationToken cancellationToken)
[External Code]

@gauravyug
Copy link

Could you please share the exact steps to reproduce this issue? If possible, it would be helpful if you could also share the project that was causing the project load to hang.".

@gfody
Copy link
Author

gfody commented Mar 13, 2025

Could you please share the exact steps to reproduce this issue? If possible, it would be helpful if you could also share the project that was causing the project load to hang.".

open the example solution is the only step. it's a sqlproj with a project reference to a csproj in the same solution. if you load the projects manually (after using the "Do not load projects" option) then the issue doesn't repro so it's not a specific project that's causing it.

be sure to have SSDT installed and not SSDT SDK-Style (Preview)

@gauravyug
Copy link

I noticed you have two projects — one is a .sqlproj and the other is a .csproj.

Your TestClr.csproj uses the SDK-style project format, whereas SSDT projects follow a legacy (non-SDK) format. Unfortunately, SDK-style and non-SDK-style(.sqlproj) projects can't be mixed within the same solution.

That's why your solution worked when you used the SSDT SDK-style project — it ensured compatibility across the projects.

gfody added a commit to gfody/SqlClrTest that referenced this issue Mar 18, 2025
@gfody
Copy link
Author

gfody commented Mar 18, 2025

@gauravyug I tried changing the format of the sqlproj to match the sdk-style, but it still hangs.

btw the solution works fine after we workaround the hang, there doesn't seem to be any compatibility issues or any problems at all - just VS hangs if we load all projects while opening the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ssdt Related to the use of DacFx in Visual Studio (SSDT) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants