Compiling .NET 3.5 executables?

Louis

Active Member
Licensed User
Longtime User
Hi there, I know using the nonoptimizing compiler, it is possible to use any .NET Framework version with any .NET DLL. But is it possible to use features from later .NET Frameworks since Basic4ppc generates .NET 2.0 executables? Would a simple configuration file fix this problem? What about C-sharp code files that use classes and methods from later versions? Would the 2.0 C-sharp compiler flag those as errors? Or would we just exclude the c-sharp code altogether? Thanks.
 

agraham

Expert
Licensed User
Longtime User
I know using the nonoptimizing compiler, it is possible to use any .NET Framework version with any .NET DLL. ?
Not true I'm afraid. A dll that is compiled using features of a later version of the .NET Framework will not run on an earlier version of the Framework.

Would the 2.0 C-sharp compiler flag those as errors?
Yes, if you try to merge the source code at compilation. However in practice this won't be a problem because each version of the .NET Framework comes with a compatible C# compiler so if it is going to run on your system then it will compile on your system.

However if you transfer the compiled merged application or just the compiled dll to a system with an earlier version of the .NET Framework then it may not run. This depends upon whether the additional features that you used are compatible with earlier versions of the Framework and whether it uses any classes added in later versions. This problem will exist whether the source of the library was merged or if a separate dll is used.
 
Top