Aug 17, 2012

C# Reference Issues with Mismatched Framworks

In C#, while adding a dll to another dll, the code would recognize the new object knows the methods within the incoming dll. After building the project, what the new dll can do is forgotten and the code breaks as though I haven't added the dll yet. The dll still appears in my reference list, but the namespace doesn't appear in the object browser anymore.

After messing with it, I figured out that the new project was working with a newer framework then my current project (which is legacy and has to stay older). VS was dropping the namespace since the frameworks weren't compatible, but was throwing a different error then I would expect to be shown.

I was able to get a new build of the incoming dll built in the old framework, and that worked as expected in the first place. I'm disappointed with MS for not throwing an error that a referenced dll uses a new framework and nothing from that project will be uses able.

Googling this problem didn't show me any solutions, but I also couldn't think of a proper search for this problem. Hopefully this text can be found by someone with better Google Fu then I had today.

No comments: