3

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

3
  • Can you at least post a screen shot? Commented Jul 29, 2015 at 19:05
  • Hi Emmanuel N, I added a screenshot to my original post. Commented Jul 29, 2015 at 19:12
  • When I've had this in prior versions of VS, restarting VS solved it for me. Commented Jul 29, 2015 at 19:14

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I was tinkering around and determined that I had selected the wrong kind of class library. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.