I'm writing a class library in C#/.NET.
I need to compile it for two different frameworks:
I want to have one set source files for the two projects, so I can make corrections in 1 copy of files and they are included in the other project automatically.
Now, if I even use "add existing item", VS 2010 creates copies; and I need to copy the latest versions every time.
I can't just change a target in project, because I'm using different versions of .dll
references, and because ms vs has some quirks.
You can use the Add as Link
feature.
It goes like this:
One option is to use the Add As Link options mentioned by the others already, but you have more options than that:
<choose>/<when>
construct you can conditionally include references to a specific assembly version depending on a condition. The target framework version and other fancy settings can also be managed through MsBuild, but you can't always edit these through the UI. You can use this in combination with #if MY_CONSTANT
to create conditionally compiled parts of the applicationWhat kind of qircks are you running into, if you share (part of) your project files, we might be able to resolve those for you.
When adding file to project choose "Add as link" not just add.
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