V
Vipul Pathak
Hi everyone,
I have a .NET 1.1 application ready to be ported on .NET 2.0.
With some of the features made obsolete in 2.0 and the new recomended
methods are not available in .NET 1.1, It leaved me with a question in mind:
How come I conditionally compile my application with .NET 1.1 and 2.0 ?
An example of obsolete method in 2.0 is:
//-------------------------------------------------------------------
// .NET 1.1: OK, .NET 2.0: Warning, Property
ConfigurationSettings.AppSettings is obsolete !
string szNewKbAddr =
System.Configuration.ConfigurationSettings.AppSettings[AppConstant.KEY_NEW_K
B_ADDRESS];
// .NET 1.1: Error, .NET 2.0: OK
string szNewKbAddr =
System.Configuration.ConfigurationManager.AppSettings[AppConstant.KEY_NEW_KB
_ADDRESS];
//-------------------------------------------------------------------
I have used the code block similar to below, for conditional compilation of
code for .NET 1.1 and .NET CF:
//-------------------------------------------------------------------
#if(_WIN32_WCE)
... ... .NET CF specific code ... ...
#else
... ... .NET 1.1 specific code ... ...
#endif
//-------------------------------------------------------------------
Do we have any solution, to either conditionally compile the single source
code application on different versions of .NET ( 1.1 and 2.0 ) ?
OR- any other solution please ?
Thanks ...
* (Vipul)() ;
I have a .NET 1.1 application ready to be ported on .NET 2.0.
With some of the features made obsolete in 2.0 and the new recomended
methods are not available in .NET 1.1, It leaved me with a question in mind:
How come I conditionally compile my application with .NET 1.1 and 2.0 ?
An example of obsolete method in 2.0 is:
//-------------------------------------------------------------------
// .NET 1.1: OK, .NET 2.0: Warning, Property
ConfigurationSettings.AppSettings is obsolete !
string szNewKbAddr =
System.Configuration.ConfigurationSettings.AppSettings[AppConstant.KEY_NEW_K
B_ADDRESS];
// .NET 1.1: Error, .NET 2.0: OK
string szNewKbAddr =
System.Configuration.ConfigurationManager.AppSettings[AppConstant.KEY_NEW_KB
_ADDRESS];
//-------------------------------------------------------------------
I have used the code block similar to below, for conditional compilation of
code for .NET 1.1 and .NET CF:
//-------------------------------------------------------------------
#if(_WIN32_WCE)
... ... .NET CF specific code ... ...
#else
... ... .NET 1.1 specific code ... ...
#endif
//-------------------------------------------------------------------
Do we have any solution, to either conditionally compile the single source
code application on different versions of .NET ( 1.1 and 2.0 ) ?
OR- any other solution please ?
Thanks ...
* (Vipul)() ;