Using .NET 3.5 Features with RunUO
First, before I show you the tricky part there are some questions you should ask yourself:
In case you have answered one or more times with "no", leave this thread. Now. Also I do not recommend to do any core-changes you don't understand! I'm neither a teacher nor a debugger: If you have some strange problems with the following changes -> revert them or try to understand what the .NET-Compiler tries to tell you....
Sooo.... you are still with me? Excitingly reading how to use those cool new features like LINQ, anonymous classes, extensions, add-ins, ....?? Here is all the magic:
First: Open ScriptCompiler.cs and search for this line:
Second: Replace this line with the following:
Repeat those steps for the VBCodeProvider(), too.
Yep, thats all... have fun
--Anheledir
First, before I show you the tricky part there are some questions you should ask yourself:
- Are you willing to recompile the core? (Remember: You will not get support in case you have some script-problems and using a modified core even though your problem has nothing to do with it!)
- Are you sure you have installed the Microsoft .NET Framework 3.5 both on your Development-Server and your Productive-Server?
- Do you know what LINQ is or do you really need other (new) features of C# or VB.NET 3.0?
- Do you know what a Dictionary-Object is and what it is used for?
- Are you a geek?
In case you have answered one or more times with "no", leave this thread. Now. Also I do not recommend to do any core-changes you don't understand! I'm neither a teacher nor a debugger: If you have some strange problems with the following changes -> revert them or try to understand what the .NET-Compiler tries to tell you....
Sooo.... you are still with me? Excitingly reading how to use those cool new features like LINQ, anonymous classes, extensions, add-ins, ....?? Here is all the magic:
First: Open ScriptCompiler.cs and search for this line:
Code:
using ( CSharpCodeProvider provider = new CSharpCodeProvider() )
Second: Replace this line with the following:
Code:
var providerOptions = new Dictionary<string, string>();
providerOptions.Add( "CompilerVersion", "v3.5" );
using ( CSharpCodeProvider provider = new CSharpCodeProvider( providerOptions ) )
Repeat those steps for the VBCodeProvider(), too.
Yep, thats all... have fun
--Anheledir