views:

29

answers:

1

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.

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
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
@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