Reference 3.5 assembly from 4.0 winforms phail

Posted by Dean Lunz on Stack Overflow See other posts from Stack Overflow or by Dean Lunz
Published on 2010-05-15T01:12:16Z Indexed on 2010/05/15 1:14 UTC
Read the original article Hit count: 313

Filed under:
|
|
|
|

So I have this utility library that is compiled as a dll under .net 3.5 and it is used by my asp.net 3.5 website. I created a .net 4.0 winforms app to push data onto the website. I want to make use of the functionality in the utilities library from this winforms app.

The problem lies in that when I make reference to the utilities library and use the code in it intellisense barks at me saying that it can't find the objects in that library. The thing is I would switch the winforms app to 3.5 which fixes the problem, but I am using Tasks which require 4.0. And because my website and utilities library both run 3.5 and my website is hosted at godaddy that currently only supports asp.net 3.5 so compiling my utilities library under 4.0 for my winforms app is not going to work because it breaks my website.

I have tried the app.config trick ala useLegacyV2RuntimeActivationPolicy="true" ...

But that did not help. Obviously I could start a new utilities project for 4.0 and and copy the code files from the existing utilities library then reference the new 4.0 utilities library in my winforms app but, that strikes me as being rather overkill when all I want to do is reference the library and use it's functionality. Not to mention that I would have two utility libraries both containing the exact same code, and if I update the code in one I will need to make sure that the other is also updated. I could use add file as link, but you get the idea.

So is there anything else I could try or any other way to solve or get around this? Or am I just going to have to break down and create a identical clone of the utilities library for 4.0.

© Stack Overflow or respective owner

Related posts about windforms

Related posts about reference