My dev machine has 2007 installed and the project references the corresponding version of PIAs but I would like my application to be able to run with 2003 at least when deployed. I tried setting the Specific Version property of the reference to false but this didn't work. My Visual Studio version is 2005, BTW.
views:
29answers:
1
A:
Use late rather than early binding (in other words, don't reference any PIAs). This MS kb article shows the difference.
However, to simplify development it can sometimes be easier to start off with early binding against the earliest version you want to support (so you get Intellisense support etc in Visual Studio) and then when you're finished, you remove the references and change it over to late binding.
ho1
2010-08-06 09:16:11
It seems to me to be basically reflection, right? So this is true for any assembly I reference? How is an app referencing/targeting .NET 3 able to be run in .NET 4? Or is this not possible?
Chry Cheng
2010-08-06 10:33:09
@Chry: They are similar, but when you do late binding for COM objects or DLLs you're not so much getting out information about it as you are just assuming that the method will be there. If you late bind .Net assemblies, then I think it's reflection that's used, but I'm not sure. You might want to create a new question to ask this so you could get better answers.
ho1
2010-08-06 10:52:52