Issue creating Service-Based SQL Database in Visual Studio 2022

John Dyson 45 Reputation points
2024-07-27T06:44:54.7333333+00:00

I am attempting to create an SQL Database in visual studio 2022:

User's image

I get the following error:

User's image

even though sql client has been added as a package reference:

User's image

Any thoughts? thanks

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

Accepted answer
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2024-07-29T03:13:52.15+00:00

    Hello @John Dyson ,

    Please try to reinstall the Data storage and processing workload from VS Installer > Modify > Workloads.

    Actually, there’s no need to install the separate NuGet package, but it’s strange that the error persisted after you installed the NuGet package. I guess there’s something wrong in settings or framework.

    Try to install .NET 8.0 manually and see if this works(Download .NET 8.0).

    Please also try to repair VS(VS Installer > More > Repair), create a new project and add the "Service-based Database" item again. If this still doesn't work, I would recommend trying to reinstall VS 2022.

    Some other suggestions:

    1. Delete the bin, obj and the hidden .vs folder in your solution/project folder. Rebuild your project and then try to add the "Service-based Database" item.
    2. Tools > NuGet Package Manager > Package Manager Settings > click "Clear All NuGet Storage" button, try to reinstall the NuGet and add the item again.
    3. Update VS 2022 and reset VS(run devenv /ResetSettings command in Developer Command Prompt for Visual Studio 2022).

    Feel free to contact us and let us know the results:)

    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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. saeed mardani 0 Reputation points
    2025-05-16T08:45:34.12+00:00

    I encountered the same issue, but after installing Tools, navigating to 'Get Tools and Features,' selecting 'Modify,' and then choosing 'Other Tool Sets' followed by 'Data Storage and Processing,' the problem was resolved."

    0 comments No comments

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.