Referencing a .NET Standard project from a SQL Database project causes Visual Studio to hang opening the solution

Simon Elms 66 Reputation points
2022-10-11T19:58:45.307+00:00

We have a solution with a common class library that needs to be called from both a SQL Database project and a .NET Core 3.1 class library project in the same solution. The SQL Database project will be loaded into SQL Server 2017 as a CLR assembly so is targeting .NET Framework 4.7.2. Since the common class library is called from both .NET Core 3.1 and .NET Framework 4.7.2
it needs to target .NET Standard 2.0.

Everything compiles okay. However, if I close Visual Studio and reopen the solution it hangs. I can see messages saying that Visual Studio has loaded each of the projects. A message then appears saying "Preparing Solution..." and it seems to get stuck there indefinitely. I've tried waiting about 10 minutes and it never gets past that message.

This was in Visual Studio Pro 2022, v17.3.5. I tried opening the same solution in Visual Studio Pro 2019, v16.11.18, and Visual Studio Pro 2017, v15.9.23. The same thing happens - VS hangs on opening.

In case it was an issue specific to the various projects in the solution I tried creating a bare-bones solution in VS Pro 2019, just an empty SQL Database project referencing an empty .NET Standard 2.0 project. The same thing happened - compiled all right when I created it but VS 2019 hung when trying to reopen the solution.

Does anyone have any suggestions for fixing this issue?

Developer technologies .NET Other
Developer technologies Visual Studio Other
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2022-10-12T03:39:09.277+00:00

    Hi @Simon Elms ,

    Welcome to Microsoft Q&A!

    I tested on my side and can reproduce your issue. I suppose it may be related to SQL Server Database project.

    Please directly report it to Product Team in Developer Community: select the menu Help > Seed Feedback > Report a Problem.

    Thanks for your understanding!

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.