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

70 Views Asked by At

We're developing a SQL Database project in Visual Studio 2022 that will be loaded into SQL Server 2017 as a CLR assembly. In the same Visual Studio solution we have a .NET Core 3.1 class library project. We would like to call another, common, class library project in the solution from both these two projects.

I see SQL Server 2017 supports CLR version 4.0, which is equivalent to .NET Framework 4.x. So we decided to use .NET Framework 4.7.2 for the SQL Database project.

As the common class library is referenced from this .NET Framework 4.7.2 project and also from the .NET Core 3.1 project it needs to be .NET Standard 2.0.

I set up the references from the Database project and the .NET Core 3.1 class library project to the common .NET Standard class library project and everything seemed to work. The solution compiled without error.

However, after closing the solution and reopening it Visual Studio 2022 hangs. I can see messages saying that it 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.

I tried upgrading Visual Studio 2022 from v17.3.3 to v17.3.5 but that didn't make any difference. I've also tried opening the solution with Visual Studio 2019 and 2017 but they have the same problem.

Does anyone have any suggestions for fixing this issue?

0

There are 0 best solutions below