3

I have created a project container In Visual studio. In this container, I have added three projects: A class library, a ASP .NET MVC Application and a Unit Test application.

Now, Im trying to add references between this projects. When Im trying to add a reference to my class library from my .NET MVC Application, I get an error that says that the reference could not be added.

Why do I get this error? Why can't I add a reference from my class library, to my mvc application?

Bryan
  • 3,421
  • 8
  • 37
  • 77

3 Answers3

1

For future reference you really need to tell the versions on what you're using : Visual Studio?, ASP.NET MVC?, and .net Framework? as Ufuk mentioned. I'll assume you mean ASP.NET 5 vNext, as I know this has an issue.

Firstly, look at other posts: Issue adding reference to class library project in ASP.NET 5 (Core)

And secondly, if it's similar to what I experienced, there appears to be a bug in the beta7, so try adding a file reference: https://stackoverflow.com/a/32399377/2537017

(That's assuming you've removed the dnxcore50 so it can use the new class library).

Community
  • 1
  • 1
JamesDill
  • 1,857
  • 1
  • 18
  • 22
0

I had such problem, and I found it's cause of post build setting on referred library project, in post build I was copying some un-managed native dll into output directory, by removing the post build event my problem solved.

Oca Amir
  • 51
  • 1
  • 1
  • 6
0

I had a similar problem. The sibling project was not visible in the Add Reference dialog when trying to add to the related project. Through a random route, I discovered that the project I was working in had a signed assembly, while the project I was trying to add as reference was unsigned. This is not allowed, but there was no indication that there was a problem with the project in the dialog. It was simply not visible.

Jim K
  • 69
  • 5