I wasn't sure whether to release a snapshot or not, because things are still very much in flux, but I decided that the ability to build on .NET 4.0 was a big enough feature to at least warrant a development snapshot (albeit a source snapshot this time).
I had to make a number of changes to be able to build on .NET 4.0:
- System.Type now overloads the == operator, so TypeBase.Equals had to be modified to use ReferenceEquals to avoid infinite recursion.
- Apply the SecurityRules(Level1) attribute to IKVM.Runtime.dll to opt out of the new security model. This is needed because IKVM.Runtime.dll has the AllowPartiallyTrustedCallers and SecurityCritical attributes.
- Modify ikvmc and the runtime to apply the SecurityRules(Level1) attribute to all generated assemblies to opt out of the new security model to work around a (likely) bug in .NET 4.0. Special thanks to Shawn Farkas for helping with this.
- Modify JNI code to move RuntimeMethodHandle from unmanaged to managed data.
- Changed IKVM.Reflection.Emit to write current runtime version into module header instead of a hardcoded "v2.0.50727".
Visual Studio 2010
Building with Visual Studio was never supported and it still isn't. You need to build with NAnt ("nant clean && nant"). You can use Visual Studio 2010 to edit the source and do test compiles (after first building with NAnt to make sure the required files are all there). If you want to use nant to build on .NET 4.0 you'll have to modify NAnt.exe.config to add the net-4.0 target framework and add a <supportedRuntime ... /> line to the <startup> section.
- Many AWT / Swing related changes as Volker continues to merge in OpenJDK code.
- Fixed java.io.File.list() to not throw a System.NotSupportedException for certain invalid paths.
- Added workaround for .NET C# compiler bug that prevents it from subclassing a Java class that implements a protected abstract method using a public method. This workaround is required to build IKVM.AWT.WinForms.dll, but the Mono C# compiler has a related bug that I have not been able to work around. Filed Mono Bug #506757.
- Added support for java.io.File.list() to VFS.
- Added support for declarative security attributes on assemblies and types.
- Added some sun.misc.Unsafe methods that appear to be used by JRuby.
- Various fixes for .NET 4.0 beta 1.
- Removed code that supports .NET 2.0 RTM (SP1 is now required).
The source-only snapshot is availabe here: ikvmsrc-0.41.3432.zip.