1

I am getting the error -

Unable to locate dependency SomeClassLibrary >= 1.0.0-*

I have been able to reproduce this issue quite simply. I start with an existing MVC 6 Web Application and an existing .net 4.5.2 class library project that both reside at the same level of the file system. I then create a blank Visual Studio solution which also resides in that same root folder. I add both the mvc and class library projects to the solution, and then attempt to reference the class library from the mvc project. This is leading me to get the error mentioned above. I've tried various builds using both VS and dnu command line, but nothing works.

There is a sample repo at github showing the issue - https://github.com/czuroski/Mvc6ReferenceError

Does anyone have any thoughts to how to resolve this? If any further information is needed, I can certainly provide it.

czuroski
  • 4,316
  • 9
  • 50
  • 86

1 Answers1

0

Are you using a standard C# class library project? That won't work without some effort (see below), but assuming you have a greenfield project and are starting from scratch you can use the new project type: Class Library (Package).

Class library (Package)

If you really want to work with your existing class library though, you'll probably want to follow the answer accepted on this question.

Although, I'm not sure how long that will be relevant, as dotnet are moving from DNX to the dotnet CLI, which is covered in this blog post by Scott Hanselman. Maybe then the process will change. I guess we'll have to wait until ASP.NET Core is in RTM to find that out.

Community
  • 1
  • 1
Alex
  • 1,549
  • 2
  • 16
  • 41
  • The process that I used was the one referred to in the SO post that you reference. However, that is not working. I did this process by creating a new mvc project, adding the existing class library and referencing it. I think the issue has something to do with using a blank solution and adding the projects/libraries from the same root directory. – czuroski Feb 11 '16 at 02:20
  • Have you tried with the new project type (Class Library (Package)), just to confirm that it's the old project type that is the issue? – Alex Feb 11 '16 at 02:22
  • yeah - I forgot to mention that I am dealing with (many) existing class library business tier applications. So I had this working previously with these projects, but now I can't get it working after restructuring. I can't be sure the structure is the problem, but if I can determine some troubleshooting steps, that would be great. – czuroski Feb 11 '16 at 02:24
  • I've found it quite tricky to blast my way through some of the beta vnext stuff, it seems to change largely from each release. Maybe it's worth waiting for the new CLI release in the next month or so, apparently it'll make the whole thing much more streamlined. Not much of a solution now though, sorry. – Alex Feb 11 '16 at 02:27
  • I will take a look at the CLI stuff. Unfortunately, I am attempting to move forward on a project now and waiting might not be a great option (hopefully I won't have to fall back to mvc 5). Thanks for the insight. – czuroski Feb 11 '16 at 02:30