I'm using VS 2005 Standard SP1, with .Net 3.5 SP1 installed on XP.
The client machines only have .Net 2.0.50727 installed (also on XP).
How can I tell the compiler to reject any classes or methods that are not available in .Net 2?
views:
72answers:
1
+6
A:
In Visual Studio 2005 this is not possible because it simply doesn't know about .Net 3.5. Visual Studio 2008 is the first version which understands .Net 3.5.
The best way to make sure you don't use any classes defined in 3.5 is to do the following
- Don't reference any DLL's from 3.5 (System.Core,System.Xml.Linq,etc ...)
- Run the FxCop rule which spots for 3.5 violations in 2.0 projects. This was initially added to Visual Studio 2008 but I don't see a reason you couldn't use it in a 2005 project if you installed the latest FxCop
Here is a link to a blog article about the FxCop rule I was talking about.
The article does talk about running it against VS2008. But I don't immediately see a reason it couldn't be used in VS2005. But I don't have an install handy to test it on.
JaredPar
2009-08-02 00:51:17
Thanks for the correction.
Jason
2009-08-02 00:53:42
@Jason, np, I almost added the exact same answer and caught myself at the last second.
JaredPar
2009-08-02 00:55:57