2

I have created a project library dll and it resides in the bin directory of the solution. I've got a second solution that references that dll. In the VS2013 IDE my 'Using' directive is happy and down n the code when I reference a class in the dll the code is happy. If I view the object reference in the object browser all look ok. I've also looked in the csproj file and the correct reference is in there. When I try to build the project I receive the type or namespace for my dll could not be found error message. I've tried cleaning first, I've also closed VS2013 and restarted all to no avail. I've also tried copying the dll to the local bin directory for this solution and re-referencing and still no joy

bilpor
  • 3,467
  • 6
  • 32
  • 77
  • 4
    You say "the code is happy" but you also say you're getting an error message - I can't see how they can both be true. Ideally, provide a short but complete program demonstrating the problem, along with the error message you're receiving. – Jon Skeet Aug 13 '15 at 11:35
  • The same project can be added to multiple solutions. Is that an option here? That is, put your project library into both solutions, and make sure all references to it are references to the project in the solution, and not to the assembly on the file system. – Polyfun Aug 13 '15 at 11:38
  • Before I hit the build button I dont receive any errors. No red lines under the using directive and no red lines under the classes I'm using from that reference. It will be hard for me to give a code sample as it's not the code that's wrong but the reference when the build button is pressed. – bilpor Aug 13 '15 at 11:38
  • @Polyfun yes the project causing the error can be used in multiple solutions and in-fact that's the point here. I've written a simple project with a single class that has some properties on it that is serialisable. It then get's referenced by one project to write data to an msmq (this project and solution referencing the dll works fine). I then have this solution that references the dll in the same way to pull from the queue, but the reference isn't referenceing correctly for some reason. (msmq send and receive required the same underlying guids etc hence the same reference). – bilpor Aug 13 '15 at 11:43
  • If you view the properties of the reference (right-click on the reference - Properties), does it say copy local = true? – Harald Coppoolse Aug 13 '15 at 11:44
  • @bilpor Have a read of https://support.microsoft.com/en-us/kb/304656 – Paul Zahra Aug 13 '15 at 11:48
  • possible duplicate of [Referenced Project gets "lost" at Compile Time](http://stackoverflow.com/questions/4286599/referenced-project-gets-lost-at-compile-time) – Paul Zahra Aug 13 '15 at 11:52

1 Answers1

3

Ok, I found the solution. The project that I am referencing is targeting .net4.5.2 of the framework. THe project that was referencing it was only referencing .net4.5 I have set this to .net4.5.2 and it now builds.

Thanks For all the input

bilpor
  • 3,467
  • 6
  • 32
  • 77
  • 1
    Yes it's a client profiling issue: http://stackoverflow.com/questions/4286599/referenced-project-gets-lost-at-compile-time – Paul Zahra Aug 13 '15 at 11:52