ToxicPineapple
ToxicPineapple

Reputation: 88

Visual Studio 2015 - Adding Reference to class library C# ASP.NET

I am trying to add references to class libraries under my Web Forms solution. I added several class libraries to the main solution (via File -> New Project -> Add to solution). When I tried to add references to them (both from the solution explorer window and the File menu), I received a popup stating simply: "Cannot add reference to ," with no additional error messages.

I verified that all projects are using the same version of the .NET Framework (4.5, NOT the client version) and the same target architecture (x64), as I have seen in other Stack Overflow posts.

I did try and add the reference via browse, and added the DLLs from the /bin/debug folder, and that actually worked. The namespaces were picked up and even shown in intellisense. My concern here is breaking these references during release builds and deployments.

Screenshot

Upvotes: 3

Views: 3315

Answers (1)

Jordec
Jordec

Reputation: 1564

I found a workaround for this problem.

When you head over to your solution and add a new project, you'll automatically be directed in the Web category. Instead head over to the Windows tab and pick that Class Library instead.

Upvotes: 4

Related Questions