Tim Rudnevsky Tim Rudnevsky - 1 month ago 9
C# Question

Error: Reference to type claims it is defined, but it could not be found

I have a solution with 3 projects:


  • ParsersBase, that define an interface IParseRule

  • ParsersLibrary, that have a reference to ParsersBase and define a class HtmlImageUrlParseRule : IParseRule

  • ParsersLibraryTest, that have a reference to ParsersBase and ParsersLibrary and define a test class with some test methods



When I'm trying to build it, I get a warning:


Reference to type 'AVSoft.ParsersBase.IParseRule' claims it is defined in 'c:\Users\Tim\Dropbox\projects\Image Downloader\ParsersLibrary\bin\Debug\ParsersLibrary.dll', but it could not be found


Why VS is trying to find
AVSoft.ParsersBase.IParseRule
in ParsersLibrary.dll? ParsersLibraryTest has a reference to ParsersBase, it just doesn't make any sense.

Answer

It was my fault, I had a ParsersLibrary project at the start and then renamed it to ParsersBase, but I didn't rename an assembly name, then I added a ParsersLibrary project again.

So, two projects had the same assembly name and it's not very good, is it? :) Assemblies overlap each other, so I have this error.