3

I am getting a build error when I attempt to build my asp.net application. The error is:

The type 'MediCare.Framework.Authentication.IUserAuthenticate' is defined in an assembly that is not referenced. You must add a reference to assembly 'MediCare.Framework, Version=1.0.1.95, Culture=neutral, PublicKeyToken=1999fa3c42b9'.

I can see the class in the library which is in the references folder. How do I debug this issue?
My intention is to point the references folder to the library source code's bin directory (since the pdb file is lcoated there and any updates to the library will reflect in the application). However, when I point the references folder to the bin directory of the source code, I get the error message above.

Update The application was originally developed in VS 2008 and I am modifying it in 2010. I think I am confused about where the GAC assemblies would be, if I am using VS 2010 (2.0 framework location or 4.0 framework location) ? .NET 4.0 has a new GAC, why?

Update (06-26-2012)
The file in the GAC ("C:\Windows\assembly\") has been deleted. But this error is still occuring.

7
  • Is it the right version? Commented Jun 14, 2012 at 15:12
  • yes, it is the correct version Commented Jun 14, 2012 at 15:13
  • Have you set the assembly reference to copy locally if not present in your GAC and referenced else where? Commented Jun 14, 2012 at 15:13
  • A few questions: How did you add the reference? Specifically, did you choose the "Browse" tab and then select the dll from it's location on disc in the "Add Reference" dialog? Secondly, how are you debugging? Using Cassini or IIS? Is the dll copied into your bin folder when you build your application? Commented Jun 27, 2012 at 6:11
  • Sorry to be picky, but can you confirm it's an error when you compile rather than when you browse the site? Commented Jun 27, 2012 at 8:29

2 Answers 2

6
+100

This could possibly be caused by version inconsistencies. Meaning, in order to fix this, I would do a complete clean build of your assemblies (and also an assemblies that might be nested inside an assembly). Just go out cold and do a new build on all assemblies. That should work.

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

1 Comment

That actually works and dot net is the absolute worst
2

Go into windows explorer, right click on the DLL file that your project is using that contains this class, and look at the version tab. Make sure version number matches what you see in the error message. My guess is that it won't.

If it does match, then check the GAC and make sure there isn't a different version of the DLL there that it could be picking up. To do that, go to windows explorer, and navigate to c:\windows\assembly. See if that assembly is in there with a different version number. If it is, you may need to delete it from the GAC (use caution though because other apps may depend on it being there).

2 Comments

The "General" tab in the GAC assembly shows the correct version. The "Versions" tab shows a 1.0.0.1 version. Why would that be?
@DotNetRookie - I think the General version is the one you care about (but I'm not 100% sure, I'm not an expert on the GAC). You might want to check out this post as well: stackoverflow.com/questions/8828725/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.