Visual Studio Error loading SQL Server Database Project

Brendan Hauk 20 Reputation points
2023-06-26T17:17:45.29+00:00

Error1

Error2

In Visual Studio 2022, I try to open a Sql Server Database Project I get these errors thrown causing the project to not load. It also won't let me create any new Sql Server Database Projects. I know they worked in my Visual Studio at one point but one day they just started throwing these errors. My colleagues are able to open these projects on their machines so it's not an issue with the project in source control. I have already tried deleing the projects and re-pulling from source, running repair on Visual Studio, and uninstalling and reinstalling Visual Studio. I have compared my settings with the settings of my colleagues and we all have the same settings. I'm also able to load other types of projects fine, it's just an issue with Sql Server Database Projects.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,449 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,306 Reputation points Microsoft External Staff
    2023-06-28T08:49:07.6133333+00:00

    Hello @Brendan Hauk ,

    Welcome to Microsoft Q&A forum.

    Did you install something(like extensions, some packages, assemblies…), remove something or modify something before this error appeared?

    Perhaps VS loaded the incorrect assembly due to something changed and lead to this error. Removing some cache files/folders may work, but it’s hard to know what cache needs to clean as it depends on the changes. If you still remember what have changed, please let us know.

    I suggest try following currently:

    1. Rename ComponentModelCache folder in C:\Users\username\AppData\Local\Microsoft\VisualStudio\17.0_XXXXXXXX folder.
    2. Navigate to %windir%\Microsoft.NET\assembly\GAC_MSIL folder(Global Assembly Cache), check if the Microsoft.SqlServer.TransactSql.ScriptDom assembly exists. If it doesn’t exist, try to install it by downloading it from here(click the Download package option to download it) => rename the .nupkg file to .zip, open it and search for the assembly file(Microsoft.SqlServer.TransactSql.ScriptDom.dll) => follow this document: Install an assembly into the global assembly cache to install it to GAC. If it exists, try to uninstall it from GAC(Remove an Assembly from the Global Assembly Cache).

    Sincerely,

    Tianyu


    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.

    1 person found this answer helpful.

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.