I have a solution with 3 projects:
ParsersBase
, that defines an interface IParseRule
ParsersLibrary
, that has a reference to ParsersBase
and defines a class HtmlImageUrlParseRule : IParseRule
ParsersLibraryTest
, that has a reference to ParsersBase
and ParsersLibrary
and defines a test class with some test methodsWhen 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 is VS trying to find AVSoft.ParsersBase.IParseRule
in ParsersLibrary.dll
? ParsersLibraryTest
has a reference to ParsersBase
; it just doesn't make any sense.
This error seems to cover a variety of scenarios. In my case, closing and re-opening Visual Studio was the trick. After restarting Visual Studio, I was able to build the project as expected.
Another way this could happen is if you're using several NuGet packages where one, probably central, package has been updated but some additional functionality packages haven't been.
To work through my recent example - the error was "Reference to type 'ConsumerSubscriptionConfigurator<>' claims it is defined in 'MassTransit', but it could not be found". This is because we had updated MassTransit from 2 to 3, but we had not updated some of the other optional packages (MassTransit.log4net and MassTransit.Autofac) to the same version number. It appears as if assembly redirection had kept everything working until we tried to use one more additional feature.
I had a similar problem. The site was running a cached version of the dll and not the one I had deployed to the bin directory. I cleared the temporary asp.net folder contents and this solved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With