Rockford Lhotka
    CTO at Magenic
    Author, speaker, software architect
    Creator of the CSLA .NET framework

About me
Contact me


Setting the NET20 compiler symbol


CSLA .NET 3.0 will work with either Microsoft .NET 2.0 or Microsoft .NET 3.0.

The NET20 compiler symbol is used in the Csla version 3.0 project to prevent compilation of Microsoft .NET 3.0 code. You can set this symbol before compiling to prevent any .NET 3.0 features from being compiled into Csla.dll, and setting this symbol allows you to build the Csla solution on a development machine where the Microsoft .NET 3.0 runtime is not installed.

If your development and/or deployment machines do not have the .NET 3.0 runtime, you should set the NET20 symbol when building CSLA .NET.

To set the NET20 compiler symbol in VB:

1.       Open the project properties designer

2.       Click the Compile tab

3.       Click Advanced Compile Options

4.       Type NET20 into the Custom constants text box

5.       Click OK

To set the NET20 compiler symbol in C#:

1.       Open the project properties designer

2.       Click the Build tab

3.       Type NET20 into the Conditional compilation symbols text box

In both cases, remember that you’ll probably need to do this for both the Debug and Release build configurations.

Also, please note that there are references to .NET 3.0 assemblies in the project! So even with NET20 defined, you will get some compiler warnings about these missing assemblies. You can either safely ignore the warnings, or you can remove the offending assembly references from the project's references.


(Updated 7/10/2007 10:16:04 PM)