简体   繁体   中英

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.

截图

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM