Why SQLClient cannot be imported n vb.net class library project

Erik Warren 20 Reputation points
2023-03-02T20:59:14.9366667+00:00

Windows11

VS Community 2022

I am working on a solution which includes several projects, A vb winforms project, a vb class library, a couple of fortran dlls.

In the WinForms project I can import System.Data.SQLClient but in the class library project there is no System.Data.SQLClient namespace. In System.Data I see only two namespaces; common and SqlTypes.

Am I missing something, or is this "working as designed"?

Developer technologies | VB
Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.6K Reputation points
    2023-03-02T21:50:15.9966667+00:00

    Probably the Class Library is based on .NET. Maybe you should create a new "Class Library (.NET Framework)" project.

    Or right-click the project in Solution Explorer, go to "Manage NuGet Packages...", find and add the System.Data.SqlClient package.

    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.