You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/11/21 12:10:01 UTC

[07/47] ignite git commit: IGNITE-5343 .NET: Work with JNI directly, get rid of C++ layer

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
index 2cc3659..77f7e3d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
@@ -23,7 +23,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
     using System.Diagnostics.CodeAnalysis;
     using System.Globalization;
     using System.Linq;
-    using System.Runtime.InteropServices;
     using System.Threading;
     using Apache.Ignite.Core.Cache.Affinity;
     using Apache.Ignite.Core.Cluster;
@@ -44,6 +43,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
     using Apache.Ignite.Core.Impl.Messaging;
     using Apache.Ignite.Core.Impl.Resource;
     using Apache.Ignite.Core.Impl.Services;
+    using Apache.Ignite.Core.Impl.Unmanaged.Jni;
     using Apache.Ignite.Core.Lifecycle;
     using Apache.Ignite.Core.Log;
     using Apache.Ignite.Core.Services;
@@ -52,32 +52,26 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
     /// <summary>
     /// Unmanaged callbacks.
     /// </summary>
-    [SuppressMessage("ReSharper", "UnusedMember.Local")]
     [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable",
         Justification = "This class instance usually lives as long as the app runs.")]
     [SuppressMessage("Microsoft.Design", "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable",
         Justification = "This class instance usually lives as long as the app runs.")]
-    internal unsafe class UnmanagedCallbacks
+    internal unsafe class UnmanagedCallbacks : MarshalByRefObject
     {
-        /** Console write delegate. */
-        private static readonly ConsoleWriteDelegate ConsoleWriteDel = ConsoleWrite;
-
-        /** Console write pointer. */
-        private static readonly void* ConsoleWritePtr =
-            Marshal.GetFunctionPointerForDelegate(ConsoleWriteDel).ToPointer();
-
-        /** Unmanaged context. */
-        private volatile UnmanagedContext _ctx;
+        /** */
+        private long _igniteId;
 
         /** Handle registry. */
         private readonly HandleRegistry _handleRegistry = new HandleRegistry();
 
+        /** JVM. */
+        private readonly Jvm _jvm;
+
         /** Grid. */
         private volatile Ignite _ignite;
 
-        /** Keep references to created delegates. */
-        // ReSharper disable once CollectionNeverQueried.Local
-        private readonly List<Delegate> _delegates = new List<Delegate>(5);
+        /** Log. */
+        private volatile ILogger _log;
 
         /** Max op code. */
         private static readonly int MaxOpCode = Enum.GetValues(typeof(UnmanagedCallbackOp)).Cast<int>().Max();
@@ -95,38 +89,9 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         /** Actions to be called upon Ignite initialization. */
         private readonly List<Action<Ignite>> _initActions = new List<Action<Ignite>>();
 
-        /** GC handle to UnmanagedCallbacks instance to prevent it from being GCed. */
-        private readonly GCHandle _thisHnd;
-
-        /** Callbacks pointer. */
-        [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
-        private readonly IntPtr _cbsPtr;
-
-        /** Log. */
-        private readonly ILogger _log;
-
-        /** Error type: generic. */
-        private const int ErrGeneric = 1;
-
-        /** Error type: initialize. */
-        private const int ErrJvmInit = 2;
-
-        /** Error type: attach. */
-        private const int ErrJvmAttach = 3;
-
         /** Operation: prepare .Net. */
         private const int OpPrepareDotNet = 1;
 
-        private delegate void ErrorCallbackDelegate(void* target, int errType, sbyte* errClsChars, int errClsCharsLen, sbyte* errMsgChars, int errMsgCharsLen, sbyte* stackTraceChars, int stackTraceCharsLen, void* errData, int errDataLen);
-
-        private delegate void LoggerLogDelegate(void* target, int level, sbyte* messageChars, int messageCharsLen, sbyte* categoryChars, int categoryCharsLen, sbyte* errorInfoChars, int errorInfoCharsLen, long memPtr);
-        private delegate bool LoggerIsLevelEnabledDelegate(void* target, int level);
-
-        private delegate void ConsoleWriteDelegate(sbyte* chars, int charsLen, bool isErr);
-
-        private delegate long InLongOutLongDelegate(void* target, int type, long val);
-        private delegate long InLongLongLongObjectOutLongDelegate(void* target, int type, long val1, long val2, long val3, void* arg);
-
         private delegate long InLongOutLongFunc(long val);
         private delegate long InLongLongLongObjectOutLongFunc(long val1, long val2, long val3, void* arg);
 
@@ -134,30 +99,14 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         /// Constructor.
         /// </summary>
         /// <param name="log">Logger.</param>
-        public UnmanagedCallbacks(ILogger log)
+        /// <param name="jvm"></param>
+        public UnmanagedCallbacks(ILogger log, Jvm jvm)
         {
             Debug.Assert(log != null);
+            Debug.Assert(jvm != null);
 
             _log = log;
-
-            var cbs = new UnmanagedCallbackHandlers
-            {
-                target = IntPtr.Zero.ToPointer(), // Target is not used in .Net as we rely on dynamic FP creation.
-
-                error = CreateFunctionPointer((ErrorCallbackDelegate)Error),
-
-                loggerLog = CreateFunctionPointer((LoggerLogDelegate)LoggerLog),
-                loggerIsLevelEnabled = CreateFunctionPointer((LoggerIsLevelEnabledDelegate)LoggerIsLevelEnabled),
-
-                inLongOutLong = CreateFunctionPointer((InLongOutLongDelegate)InLongOutLong),
-                inLongLongObjectOutLong = CreateFunctionPointer((InLongLongLongObjectOutLongDelegate)InLongLongLongObjectOutLong)
-            };
-
-            _cbsPtr = Marshal.AllocHGlobal(UU.HandlersSize());
-
-            Marshal.StructureToPtr(cbs, _cbsPtr, false);
-
-            _thisHnd = GCHandle.Alloc(this);
+            _jvm = jvm;
 
             InitHandlers();
         }
@@ -170,6 +119,22 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             get { return _handleRegistry; }
         }
 
+        /// <summary>
+        /// Gets the ignite identifier.
+        /// </summary>
+        public long IgniteId
+        {
+            get { return _igniteId; }
+        }
+
+        /// <summary>
+        /// Gets the JVM.
+        /// </summary>
+        public Jvm Jvm
+        {
+            get { return _jvm; }
+        }
+
         #region HANDLERS
 
         /// <summary>
@@ -266,7 +231,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         #region IMPLEMENTATION: GENERAL PURPOSE
 
         [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        private long InLongOutLong(void* target, int type, long val)
+        internal long InLongOutLong(int type, long val)
         {
             try
             {
@@ -286,15 +251,12 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             catch (Exception e)
             {
                 _log.Error(e, "Failure in Java callback");
-
-                UU.ThrowToJava(_ctx.NativeContext, e);
-
-                return 0;
+                throw;
             }
         }
 
         [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        private long InLongLongLongObjectOutLong(void* target, int type, long val1, long val2, long val3, void* arg)
+        internal long InLongLongLongObjectOutLong(int type, long val1, long val2, long val3, IntPtr arg)
         {
             try
             {
@@ -309,15 +271,12 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
                 if (!hnd.AllowUninitialized)
                     _initEvent.Wait();
 
-                return hnd.Handler(val1, val2, val3, arg);
+                return hnd.Handler(val1, val2, val3, arg.ToPointer());
             }
             catch (Exception e)
             {
                 _log.Error(e, "Failure in Java callback");
-
-                UU.ThrowToJava(_ctx.NativeContext, e);
-
-                return 0;
+                throw;
             }
         }
 
@@ -680,8 +639,8 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
                 if (receiver != null)
                 {
-                    var target = new PlatformJniTarget(new UnmanagedNonReleaseableTarget(_ctx, cache), 
-                        _ignite.Marshaller);
+                    var cacheRef = _jvm.AttachCurrentThread().NewGlobalRef((IntPtr) cache);
+                    var target = new PlatformJniTarget(cacheRef, _ignite.Marshaller);
                     receiver.Receive(_ignite, target, stream, keepBinary);
                 }
 
@@ -1069,7 +1028,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
         private long OnStart(long memPtr, long unused, long unused1, void* proc)
         {
-            var proc0 = UU.Acquire(_ctx, proc);
+            var proc0 = _jvm.AttachCurrentThread().NewGlobalRef((IntPtr) proc);
 
             using (var stream = IgniteManager.Memory.Get(memPtr).GetStream())
             {
@@ -1081,14 +1040,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
         private long OnStop(long unused)
         {
-            Marshal.FreeHGlobal(_cbsPtr);
-
-            // ReSharper disable once ImpureMethodCallOnReadonlyValueField
-            _thisHnd.Free();
-
-            // Allow context to be collected, which will cause resource cleanup in finalizer.
-            _ctx = null;
-
             // Notify grid
             var ignite = _ignite;
 
@@ -1098,34 +1049,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             return 0;
         }
 
-        private void Error(void* target, int errType, sbyte* errClsChars, int errClsCharsLen, sbyte* errMsgChars,
-            int errMsgCharsLen, sbyte* stackTraceChars, int stackTraceCharsLen, void* errData, int errDataLen)
-        {
-            // errData mechanism is only needed for CachePartialUpdateException and is no longer used,
-            // since CacheImpl handles all errors itself.
-            Debug.Assert(errDataLen == 0);
-            Debug.Assert(errData == null);
-
-            string errCls = IgniteUtils.Utf8UnmanagedToString(errClsChars, errClsCharsLen);
-            string errMsg = IgniteUtils.Utf8UnmanagedToString(errMsgChars, errMsgCharsLen);
-            string stackTrace = IgniteUtils.Utf8UnmanagedToString(stackTraceChars, stackTraceCharsLen);
-
-            switch (errType)
-            {
-                case ErrGeneric:
-                    throw ExceptionUtils.GetException(_ignite, errCls, errMsg, stackTrace);
-
-                case ErrJvmInit:
-                    throw ExceptionUtils.GetJvmInitializeException(errCls, errMsg, stackTrace);
-
-                case ErrJvmAttach:
-                    throw new IgniteException("Failed to attach to JVM.");
-
-                default:
-                    throw new IgniteException("Unknown exception [cls=" + errCls + ", msg=" + errMsg + ']');
-            }
-        }
-
         private long OnClientDisconnected(long unused)
         {
             _ignite.OnClientDisconnected();
@@ -1140,18 +1063,13 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             return 0;
         }
 
-        private void LoggerLog(void* target, int level, sbyte* messageChars, int messageCharsLen, sbyte* categoryChars,
-            int categoryCharsLen, sbyte* errorInfoChars, int errorInfoCharsLen, long memPtr)
+        internal void LoggerLog(int level, string message, string category, string nativeError, long memPtr)
         {
             // When custom logger in .NET is not defined, Java should not call us.
             Debug.Assert(!(_log is JavaLogger));
 
             SafeCall(() =>
             {
-                var message = IgniteUtils.Utf8UnmanagedToString(messageChars, messageCharsLen);
-                var category = IgniteUtils.Utf8UnmanagedToString(categoryChars, categoryCharsLen);
-                var nativeError = IgniteUtils.Utf8UnmanagedToString(errorInfoChars, errorInfoCharsLen);
-
                 Exception ex = null;
 
                 if (memPtr != 0 && _ignite != null)
@@ -1166,7 +1084,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             }, true);
         }
 
-        private bool LoggerIsLevelEnabled(void* target, int level)
+        internal bool LoggerIsLevelEnabled(int level)
         {
             // When custom logger in .NET is not defined, Java should not call us.
             Debug.Assert(!(_log is JavaLogger));
@@ -1174,24 +1092,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             return SafeCall(() => _log.IsEnabled((LogLevel) level), true);
         }
 
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        private static void ConsoleWrite(sbyte* chars, int charsLen, bool isErr)
-        {
-            try
-            {
-                var str = IgniteUtils.Utf8UnmanagedToString(chars, charsLen);
-
-                var target = isErr ? Console.Error : Console.Out;
-
-                target.Write(str);
-
-            }
-            catch (Exception ex)
-            {
-                Console.Error.WriteLine("ConsoleWrite unmanaged callback failed: " + ex);
-            }
-        }
-
         private long PluginProcessorIgniteStop(long val)
         {
             _ignite.PluginProcessor.OnIgniteStop(val != 0);
@@ -1225,7 +1125,8 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
                 if (affBase != null)
                 {
-                    var baseFunc0 = new PlatformJniTarget(UU.Acquire(_ctx, baseFunc), _ignite.Marshaller);
+                    var baseFuncRef = _jvm.AttachCurrentThread().NewGlobalRef((IntPtr) baseFunc);
+                    var baseFunc0 = new PlatformJniTarget(baseFuncRef, _ignite.Marshaller);
 
                     affBase.SetBaseFunction(new PlatformAffinityFunction(baseFunc0));
                 }
@@ -1312,8 +1213,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             catch (Exception e)
             {
                 _log.Error(e, "Failure in Java callback");
-
-                UU.ThrowToJava(_ctx.NativeContext, e);
+                throw;
             }
         }
 
@@ -1330,32 +1230,13 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             catch (Exception e)
             {
                 _log.Error(e, "Failure in Java callback");
-
-                UU.ThrowToJava(_ctx.NativeContext, e);
-
-                return default(T);
+                throw;
             }
         }
 
         #endregion
         
         /// <summary>
-        /// Callbacks pointer.
-        /// </summary>
-        public void* CallbacksPointer
-        {
-            get { return _cbsPtr.ToPointer(); }
-        }
-
-        /// <summary>
-        /// Gets the context.
-        /// </summary>
-        public UnmanagedContext Context
-        {
-            get { return _ctx; }
-        }
-
-        /// <summary>
         /// Gets the log.
         /// </summary>
         public ILogger Log
@@ -1364,22 +1245,11 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         }
 
         /// <summary>
-        /// Create function pointer for the given function.
+        /// Sets the context.
         /// </summary>
-        private void* CreateFunctionPointer(Delegate del)
-        {
-            _delegates.Add(del); // Prevent delegate from being GC-ed.
-
-            return Marshal.GetFunctionPointerForDelegate(del).ToPointer();
-        }
-
-        /// <param name="context">Context.</param>
-        public void SetContext(void* context)
+        public void SetContext(long igniteId)
         {
-            Debug.Assert(context != null);
-            Debug.Assert(_ctx == null);
-
-            _ctx = new UnmanagedContext(context);
+            _igniteId = igniteId;
         }
 
         /// <summary>
@@ -1409,17 +1279,15 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         /// </summary>
         public void Cleanup()
         {
+            // This instance crosses AppDomain boundaries and is GCed with a delay.
+            // Release all external references.
+
             _ignite = null;
+            _log = null;
 
-            _handleRegistry.Close();
-        }
+            _jvm.ReleaseCallbacks(_igniteId);
 
-        /// <summary>
-        /// Gets the console write handler.
-        /// </summary>
-        public static void* ConsoleWriteHandler
-        {
-            get { return ConsoleWritePtr; }
+            _handleRegistry.Close();
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedContext.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedContext.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedContext.cs
deleted file mode 100644
index 89d2071..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedContext.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Apache.Ignite.Core.Impl.Unmanaged
-{
-    /// <summary>
-    /// Unmanaged context.
-    /// Wrapper around native ctx pointer to track finalization.
-    /// </summary>
-    internal unsafe class UnmanagedContext
-    {
-        /** Context */
-        private readonly void* _nativeCtx;
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        public UnmanagedContext(void* ctx)
-        {
-            _nativeCtx = ctx;
-        }
-
-        /// <summary>
-        /// Gets the native context pointer.
-        /// </summary>
-        public void* NativeContext
-        {
-            get { return _nativeCtx; }
-        }
-
-        /// <summary>
-        /// Destructor.
-        /// </summary>
-        ~UnmanagedContext()
-        {
-            UnmanagedUtils.DeleteContext(_nativeCtx); // Release CPP object.
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs
deleted file mode 100644
index d044c5f..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Apache.Ignite.Core.Impl.Unmanaged
-{
-    using System.Diagnostics.CodeAnalysis;
-
-    /// <summary>
-    /// Unmanaged target which does not require explicit release.
-    /// </summary>
-    internal unsafe class UnmanagedNonReleaseableTarget : IUnmanagedTarget
-    {
-        /** Context. */
-        private readonly UnmanagedContext _ctx;
-
-        /** Target. */
-        private readonly void* _target;
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        /// <param name="ctx">Context.</param>
-        /// <param name="target">Target.</param>
-        public UnmanagedNonReleaseableTarget(UnmanagedContext ctx, void* target)
-        {
-            _ctx = ctx;
-            _target = target;
-        }
-
-        /** <inheritdoc /> */
-        public void* Context
-        {
-            get { return _ctx.NativeContext; }
-        }
-
-        /** <inheritdoc /> */
-        public void* Target
-        {
-            get { return _target; }
-        }
-
-        /** <inheritdoc /> */
-        public IUnmanagedTarget ChangeTarget(void* target)
-        {
-            return new UnmanagedTarget(_ctx, target);
-        }
-
-        /** <inheritdoc /> */
-        [SuppressMessage("Microsoft.Usage", "CA1816:CallGCSuppressFinalizeCorrectly",
-            Justification = "There is no finalizer.")]
-        public void Dispose()
-        {
-            // No-op.
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedTarget.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedTarget.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedTarget.cs
deleted file mode 100644
index a5e2cb0..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedTarget.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Apache.Ignite.Core.Impl.Unmanaged
-{
-    using System;
-    using System.Runtime.InteropServices;
-    using UU = UnmanagedUtils;
-
-    /// <summary>
-    /// Base unmanaged target implementation.
-    /// </summary>
-    internal sealed unsafe class UnmanagedTarget : CriticalHandle, IUnmanagedTarget
-    {
-        /** Context. */
-        private readonly UnmanagedContext _ctx;
-        
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        /// <param name="ctx">Context.</param>
-        /// <param name="target">Target.</param>
-        public UnmanagedTarget(UnmanagedContext ctx, void* target)
-            : base(IntPtr.Zero)
-        {
-            _ctx = ctx;
-            
-            SetHandle(new IntPtr(target));
-        }
-
-        /** <inheritdoc /> */
-        public void* Context
-        {
-            get { return _ctx.NativeContext; }
-        }
-
-        /** <inheritdoc /> */
-        public void* Target
-        {
-            get { return handle.ToPointer(); }
-        }
-
-        /** <inheritdoc /> */
-        public IUnmanagedTarget ChangeTarget(void* target)
-        {
-            return new UnmanagedTarget(_ctx, target);
-        }
-
-        /** <inheritdoc /> */
-        protected override bool ReleaseHandle()
-        {
-            UU.Release(this);
-            
-            return true;
-        }
-
-        /** <inheritdoc /> */
-        public override bool IsInvalid
-        {
-            get { return handle == IntPtr.Zero; }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
index 511bb7a..58586a9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
@@ -17,13 +17,7 @@
 
 namespace Apache.Ignite.Core.Impl.Unmanaged
 {
-    using System;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime.InteropServices;
-    using System.Threading.Tasks;
-    using Apache.Ignite.Core.Common;
-    using JNI = IgniteJniNativeMethods;
+    using Apache.Ignite.Core.Impl.Unmanaged.Jni;
 
     /// <summary>
     /// Unmanaged utility classes.
@@ -33,93 +27,47 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         /** Interop factory ID for .Net. */
         private const int InteropFactoryId = 1;
 
-        /// <summary>
-        /// Initializer.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
-        static UnmanagedUtils()
-        {
-            var platform = Environment.Is64BitProcess ? "x64" : "x86";
-
-            var resName = string.Format("{0}.{1}", platform, IgniteUtils.FileIgniteJniDll);
-
-            var path = IgniteUtils.UnpackEmbeddedResource(resName, IgniteUtils.FileIgniteJniDll);
-
-            var ptr = NativeMethods.LoadLibrary(path);
-
-            if (ptr == IntPtr.Zero)
-            {
-                var err = Marshal.GetLastWin32Error();
-
-                throw new IgniteException(string.Format("Failed to load {0} from {1}: [{2}]",
-                    IgniteUtils.FileIgniteJniDll, path, IgniteUtils.FormatWin32Error(err)));
-            }
-
-            AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;
-
-            JNI.SetConsoleHandler(UnmanagedCallbacks.ConsoleWriteHandler);
-
-            // Clean directories in background to avoid extra work on start.
-            Task.Factory.StartNew(IgniteUtils.TryCleanTempDirectories);
-        }
-
-        /// <summary>
-        /// Handles the DomainUnload event of the current AppDomain.
-        /// </summary>
-        private static void CurrentDomain_DomainUnload(object sender, EventArgs e)
-        {
-            // Clean the handler to avoid JVM crash.
-            var removedCnt = JNI.RemoveConsoleHandler(UnmanagedCallbacks.ConsoleWriteHandler);
-
-            Debug.Assert(removedCnt == 1);
-        }
-
-        /// <summary>
-        /// No-op initializer used to force type loading and static constructor call.
-        /// </summary>
-        internal static void Initialize()
-        {
-            // No-op.
-        }
-
         #region NATIVE METHODS: PROCESSOR
 
-        internal static void IgnitionStart(UnmanagedContext ctx, string cfgPath, string gridName,
-            bool clientMode, bool userLogger)
+        internal static void IgnitionStart(Env env, string cfgPath, string gridName,
+            bool clientMode, bool userLogger, long igniteId)
         {
             using (var mem = IgniteManager.Memory.Allocate().GetStream())
+            using (var cfgPath0 = env.NewStringUtf(cfgPath))
+            using (var gridName0 = env.NewStringUtf(gridName))
             {
                 mem.WriteBool(clientMode);
                 mem.WriteBool(userLogger);
 
-                sbyte* cfgPath0 = IgniteUtils.StringToUtf8Unmanaged(cfgPath);
-                sbyte* gridName0 = IgniteUtils.StringToUtf8Unmanaged(gridName);
-
-                try
-                {
-                    // OnStart receives InteropProcessor referece and stores it.
-                    JNI.IgnitionStart(ctx.NativeContext, cfgPath0, gridName0, InteropFactoryId,
-                        mem.SynchronizeOutput());
-                }
-                finally
-                {
-                    Marshal.FreeHGlobal(new IntPtr(cfgPath0));
-                    Marshal.FreeHGlobal(new IntPtr(gridName0));
-                }
+                // Additional data.
+                mem.WriteBool(false);
+                mem.WriteBool(false);
+
+                long* args = stackalloc long[5];
+                args[0] = cfgPath == null ? 0 : cfgPath0.Target.ToInt64();
+                args[1] = gridName == null ? 0 : gridName0.Target.ToInt64();
+                args[2] = InteropFactoryId;
+                args[3] = igniteId;
+                args[4] = mem.SynchronizeOutput();
+
+                // OnStart receives InteropProcessor reference and stores it.
+                var methodId = env.Jvm.MethodId;
+                env.CallStaticVoidMethod(methodId.PlatformIgnition, methodId.PlatformIgnitionStart, args);
             }
         }
 
-        internal static bool IgnitionStop(void* ctx, string gridName, bool cancel)
+        internal static bool IgnitionStop(string gridName, bool cancel)
         {
-            sbyte* gridName0 = IgniteUtils.StringToUtf8Unmanaged(gridName);
+            var env = Jvm.Get().AttachCurrentThread();
+            var methodId = env.Jvm.MethodId;
 
-            try
+            using (var gridName1 = env.NewStringUtf(gridName))
             {
-                return JNI.IgnitionStop(ctx, gridName0, cancel);
-            }
-            finally
-            {
-                Marshal.FreeHGlobal(new IntPtr(gridName0));
+                long* args = stackalloc long[2];
+                args[0] = gridName == null ? 0 : gridName1.Target.ToInt64();
+                args[1] = cancel ? 1 : 0;
+
+                return env.CallStaticBoolMethod(methodId.PlatformIgnition, methodId.PlatformIgnitionStop, args);
             }
         }
 
@@ -127,122 +75,127 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
         #region NATIVE METHODS: TARGET
 
-        internal static long TargetInLongOutLong(IUnmanagedTarget target, int opType, long memPtr)
+        internal static long TargetInLongOutLong(GlobalRef target, int opType, long memPtr)
         {
-            return JNI.TargetInLongOutLong(target.Context, target.Target, opType, memPtr);
-        }
+            var jvm = target.Jvm;
 
-        internal static long TargetInStreamOutLong(IUnmanagedTarget target, int opType, long memPtr)
-        {
-            return JNI.TargetInStreamOutLong(target.Context, target.Target, opType, memPtr);
-        }
+            long* args = stackalloc long[2];
+            args[0] = opType;
+            args[1] = memPtr;
 
-        internal static void TargetInStreamOutStream(IUnmanagedTarget target, int opType, long inMemPtr, long outMemPtr)
-        {
-            JNI.TargetInStreamOutStream(target.Context, target.Target, opType, inMemPtr, outMemPtr);
+            return jvm.AttachCurrentThread().CallLongMethod(target, jvm.MethodId.TargetInLongOutLong, args);
         }
 
-        internal static IUnmanagedTarget TargetInStreamOutObject(IUnmanagedTarget target, int opType, long inMemPtr)
+        internal static long TargetInStreamOutLong(GlobalRef target, int opType, long memPtr)
         {
-            void* res = JNI.TargetInStreamOutObject(target.Context, target.Target, opType, inMemPtr);
+            var jvm = target.Jvm;
 
-            if (res == null)
-                return null;
+            long* args = stackalloc long[2];
+            args[0] = opType;
+            args[1] = memPtr;
 
-            return target.ChangeTarget(res);
+            return jvm.AttachCurrentThread().CallLongMethod(target, jvm.MethodId.TargetInStreamOutLong, args);
         }
 
-        internal static IUnmanagedTarget TargetInObjectStreamOutObjectStream(IUnmanagedTarget target, int opType, void* arg, long inMemPtr, long outMemPtr)
+        internal static void TargetInStreamOutStream(GlobalRef target, int opType, long inMemPtr,
+            long outMemPtr)
         {
-            void* res = JNI.TargetInObjectStreamOutObjectStream(target.Context, target.Target, opType, arg, inMemPtr, outMemPtr);
+            var jvm = target.Jvm;
 
-            if (res == null)
-                return null;
+            long* args = stackalloc long[3];
+            args[0] = opType;
+            args[1] = inMemPtr;
+            args[2] = outMemPtr;
 
-            return target.ChangeTarget(res);
+            jvm.AttachCurrentThread().CallVoidMethod(target, jvm.MethodId.TargetInStreamOutStream, args);
         }
 
-        internal static void TargetOutStream(IUnmanagedTarget target, int opType, long memPtr)
+        internal static GlobalRef TargetInStreamOutObject(GlobalRef target, int opType, long inMemPtr)
         {
-            JNI.TargetOutStream(target.Context, target.Target, opType, memPtr);
-        }
+            var jvm = target.Jvm;
 
-        internal static IUnmanagedTarget TargetOutObject(IUnmanagedTarget target, int opType)
-        {
-            void* res = JNI.TargetOutObject(target.Context, target.Target, opType);
+            long* args = stackalloc long[2];
+            args[0] = opType;
+            args[1] = inMemPtr;
 
-            return target.ChangeTarget(res);
+            return jvm.AttachCurrentThread().CallObjectMethod(
+                target, jvm.MethodId.TargetInStreamOutObject, args);
         }
 
-        internal static void TargetInStreamAsync(IUnmanagedTarget target, int opType, long memPtr)
+        internal static GlobalRef TargetInObjectStreamOutObjectStream(GlobalRef target, int opType, 
+            GlobalRef arg, long inMemPtr, long outMemPtr)
         {
-            JNI.TargetInStreamAsync(target.Context, target.Target, opType, memPtr);
-        }
+            var jvm = target.Jvm;
 
-        internal static IUnmanagedTarget TargetInStreamOutObjectAsync(IUnmanagedTarget target, int opType, long memPtr)
-        {
-            void* res = JNI.TargetInStreamOutObjectAsync(target.Context, target.Target, opType, memPtr);
+            long* args = stackalloc long[4];
+            args[0] = opType;
+            args[1] = (long) arg.Target;
+            args[2] = inMemPtr;
+            args[3] = outMemPtr;
 
-            return target.ChangeTarget(res);
+            return jvm.AttachCurrentThread().CallObjectMethod(
+                target, jvm.MethodId.TargetInObjectStreamOutObjectStream, args);
         }
 
-        #endregion
-
-        #region NATIVE METHODS: MISCELANNEOUS
-
-        internal static void Reallocate(long memPtr, int cap)
+        internal static void TargetOutStream(GlobalRef target, int opType, long memPtr)
         {
-            int res = JNI.Reallocate(memPtr, cap);
+            var jvm = target.Jvm;
 
-            if (res != 0)
-                throw new IgniteException("Failed to reallocate external memory [ptr=" + memPtr + 
-                    ", capacity=" + cap + ']');
+            long* args = stackalloc long[4];
+            args[0] = opType;
+            args[1] = memPtr;
+
+            jvm.AttachCurrentThread().CallVoidMethod(target, jvm.MethodId.TargetOutStream, args);
         }
 
-        internal static IUnmanagedTarget Acquire(UnmanagedContext ctx, void* target)
+        internal static GlobalRef TargetOutObject(GlobalRef target, int opType)
         {
-            void* target0 = JNI.Acquire(ctx.NativeContext, target);
+            var jvm = target.Jvm;
 
-            return new UnmanagedTarget(ctx, target0);
-        }
+            long opType0 = opType;
 
-        internal static void Release(IUnmanagedTarget target)
-        {
-            JNI.Release(target.Target);
+            return jvm.AttachCurrentThread().CallObjectMethod(
+                target, jvm.MethodId.TargetOutObject, &opType0);
         }
 
-        internal static void ThrowToJava(void* ctx, Exception e)
+        internal static void TargetInStreamAsync(GlobalRef target, int opType, long memPtr)
         {
-            char* msgChars = (char*)IgniteUtils.StringToUtf8Unmanaged(e.Message);
+            var jvm = target.Jvm;
 
-            try
-            {
-                JNI.ThrowToJava(ctx, msgChars);
-            }
-            finally
-            {
-                Marshal.FreeHGlobal(new IntPtr(msgChars));
-            }
-        }
+            long* args = stackalloc long[4];
+            args[0] = opType;
+            args[1] = memPtr;
 
-        internal static int HandlersSize()
-        {
-            return JNI.HandlersSize();
+            jvm.AttachCurrentThread().CallVoidMethod(target, jvm.MethodId.TargetInStreamAsync, args);
         }
 
-        internal static void* CreateContext(void* opts, int optsLen, void* cbs)
+        internal static GlobalRef TargetInStreamOutObjectAsync(GlobalRef target, int opType, long memPtr)
         {
-            return JNI.CreateContext(opts, optsLen, cbs);
-        }
+            var jvm = target.Jvm;
 
-        internal static void DeleteContext(void* ctx)
-        {
-            JNI.DeleteContext(ctx);
+            long* args = stackalloc long[4];
+            args[0] = opType;
+            args[1] = memPtr;
+
+            return jvm.AttachCurrentThread().CallObjectMethod(
+                target, jvm.MethodId.TargetInStreamOutObjectAsync, args);
         }
 
-        internal static void DestroyJvm(void* ctx)
+        #endregion
+
+        #region NATIVE METHODS: MISCELANNEOUS
+
+        internal static void Reallocate(long memPtr, int cap)
         {
-            JNI.DestroyJvm(ctx);
+            var jvm = Jvm.Get();
+            var methodId = jvm.MethodId;
+
+            long* args = stackalloc long[4];
+            args[0] = memPtr;
+            args[1] = cap;
+
+            jvm.AttachCurrentThread().CallStaticVoidMethod(methodId.PlatformUtils, methodId.PlatformUtilsReallocate,
+                args);
         }
 
         #endregion

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Core/build-common.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/build-common.ps1 b/modules/platforms/dotnet/Apache.Ignite.Core/build-common.ps1
deleted file mode 100644
index db24751..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/build-common.ps1
+++ /dev/null
@@ -1,77 +0,0 @@
-param([string]$configuration="Debug", [string]$msbuildexe = "MSBuild.exe")
-
-$x64 = [System.Environment]::Is64BitOperatingSystem
-$jdkRegKey = 'Software\JavaSoft\Java Development Kit'
-
-# Fisrt, check if JAVA_HOME env vars are set
-if (Test-Path Env:\JAVA_HOME) {
-    if ($x64 -and !$env:JAVA_HOME64) {
-        $env:JAVA_HOME64 = $env:JAVA_HOME
-    }
-    elseif (!$env:JAVA_HOME32) {
-        $env:JAVA_HOME32 = $env:JAVA_HOME
-    }
-}
-
-# Next, check registry
-Function GetJavaHome([string]$path, [Microsoft.Win32.RegistryView] $mode) {
-    $key = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $mode).OpenSubKey($path)
-
-    if ($key -eq $null) {
-        return $null
-    }
-
-    $subKeys = $key.GetSubKeyNames()
-    $curVer = $key.GetValue("CurrentVersion")
-
-    if ($subKeys.Length -eq 0) {
-        return $null
-    }
-
-    if ($curVer -eq $null -or !$subKeys.Contains($curVer)) {
-        $curVer = $subKeys[0]
-    }
-            
-    return $key.OpenSubKey($curVer).GetValue("JavaHome")
-}
-
-# do not read registry if env vars are already set
-if (!$env:JAVA_HOME32) {
-    $env:JAVA_HOME32 = GetJavaHome $jdkRegKey Registry32
-}
-
-
-if ($x64 -and !$env:JAVA_HOME64) {
-    $env:JAVA_HOME64 = GetJavaHome $jdkRegKey Registry64
-}
-
-echo "JAVA_HOME64: $env:JAVA_HOME64"
-echo "JAVA_HOME32: $env:JAVA_HOME32"
-echo "msbuildexe: $msbuildexe"
-echo "x64: $x64"
-
-# build common project
-if ($env:JAVA_HOME64) {
-    $env:JAVA_HOME = $env:JAVA_HOME64
-
-    & $msbuildexe "..\..\cpp\common\project\vs\common.vcxproj" /p:Platform=x64 /p:Configuration=$Configuration /t:Rebuild
-}
-
-if ($env:JAVA_HOME32) {
-    $env:JAVA_HOME = $env:JAVA_HOME32
-
-    & $msbuildexe "..\..\cpp\common\project\vs\common.vcxproj" /p:Platform=Win32 /p:Configuration=$Configuration /t:Rebuild
-}
-
-# build jni project
-if ($env:JAVA_HOME64) {
-    $env:JAVA_HOME = $env:JAVA_HOME64
-
-    & $msbuildexe "..\..\cpp\jni\project\vs\jni.vcxproj" /p:Platform=x64 /p:Configuration=$Configuration /t:Rebuild
-}
-
-if ($env:JAVA_HOME32) {
-    $env:JAVA_HOME = $env:JAVA_HOME32
-
-    & $msbuildexe "..\..\cpp\jni\project\vs\jni.vcxproj" /p:Platform=Win32 /p:Configuration=$Configuration /t:Rebuild
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
index 372c2ed..4b302cc 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
@@ -20,7 +20,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
+    <RunCodeAnalysis>false</RunCodeAnalysis>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <DocumentationFile>bin\Debug\Apache.Ignite.EntityFramework.XML</DocumentationFile>
@@ -35,6 +35,7 @@
     <DebugType>none</DebugType>
     <DocumentationFile>bin\Release\Apache.Ignite.EntityFramework.XML</DocumentationFile>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <RunCodeAnalysis>false</RunCodeAnalysis>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
index 142ce73..af87404 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
@@ -20,7 +20,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
+    <RunCodeAnalysis>false</RunCodeAnalysis>
     <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
@@ -32,6 +32,8 @@
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Apache.Ignite.Log4Net.XML</DocumentationFile>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <RunCodeAnalysis>false</RunCodeAnalysis>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.ndproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.ndproj b/modules/platforms/dotnet/Apache.Ignite.ndproj
index 9f5287b..34aaa4c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.ndproj
+++ b/modules/platforms/dotnet/Apache.Ignite.ndproj
@@ -2347,7 +2347,8 @@ warnif count > 0
 from t in JustMyCode.Types.Where(t =>
    !t.IsStatic && !t.IsInterface &&
    !t.IsEnumeration && !t.IsDelegate &&
-   !t.IsGeneratedByCompiler)
+   !t.IsGeneratedByCompiler &&
+   !t.FullName.Contains(".Jni."))
 
 let methodsThatCanBeMadeStatic = 
    from m in t.InstanceMethods
@@ -2477,7 +2478,7 @@ select new {
       <Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[//<Name>Avoid the Singleton pattern</Name>
 warnif count > 0
 from t in Application.Types
-where !t.IsStatic && !t.IsAbstract && (t.IsClass || t.IsStructure)
+where !t.IsStatic && !t.IsAbstract && (t.IsClass || t.IsStructure) && t.Name != "Jvm"
 
 // All ctors of a singleton are private
 where t.Constructors.Where(ctor => !ctor.IsPrivate).Count() == 0
@@ -5641,7 +5642,8 @@ from f in JustMyCode.Fields where
    !f.IsEnumValue &&  // The IL code never explicitly uses enumeration value.
     f.Name != "value__"  && // Field named 'value__' are relative to enumerations and the IL code never explicitly uses them.
    !f.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&
-   !f.IsGeneratedByCompiler
+   !f.IsGeneratedByCompiler &&
+   !f.ParentType.Name.StartsWith("Jvm")
    // If you don't want to link NDepend.API.dll, you can use your own IsNotDeadCodeAttribute
    // and adapt the source code of this rule.
 select new {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index fe83ccd..1ca7b14 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -2,14 +2,9 @@
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual Studio 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core", "Apache.Ignite.Core\Apache.Ignite.Core.csproj", "{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{4F7E4917-4612-4B96-9838-025711ADE391} = {4F7E4917-4612-4B96-9838-025711ADE391}
-	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core.Tests", "Apache.Ignite.Core.Tests\Apache.Ignite.Core.Tests.csproj", "{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\cpp\common\project\vs\common.vcxproj", "{B63F2E01-5157-4719-8491-0E1C7CD3B701}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core.Tests.TestDll", "Apache.Ignite.Core.Tests.TestDll\Apache.Ignite.Core.Tests.TestDll.csproj", "{F4A69E2D-908E-4F0F-A794-84D508D60E5F}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite", "Apache.Ignite\Apache.Ignite.csproj", "{27F7F3C6-BDDE-43A9-B565-856F8395A04B}"
@@ -40,8 +35,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		README.md = README.md
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jni", "..\cpp\jni\project\vs\jni.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Linq", "Apache.Ignite.Linq\Apache.Ignite.Linq.csproj", "{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.AspNet", "Apache.Ignite.AspNet\Apache.Ignite.AspNet.csproj", "{13EA96FC-CC83-4164-A7C0-4F30ED797460}"
@@ -59,201 +52,65 @@ EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
-		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
-		Release|x64 = Release|x64
-		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Debug|x64.ActiveCfg = Debug|x64
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Debug|x64.Build.0 = Debug|x64
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Debug|x86.ActiveCfg = Debug|x86
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Debug|x86.Build.0 = Debug|x86
 		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Release|Any CPU.Build.0 = Release|Any CPU
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Release|x64.ActiveCfg = Release|x64
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Release|x64.Build.0 = Release|x64
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Release|x86.ActiveCfg = Release|x86
-		{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}.Release|x86.Build.0 = Release|x86
 		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Debug|x64.Build.0 = Debug|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Debug|x86.Build.0 = Debug|Any CPU
 		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Release|Any CPU.Build.0 = Release|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Release|x64.ActiveCfg = Release|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Release|x64.Build.0 = Release|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Release|x86.ActiveCfg = Release|Any CPU
-		{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}.Release|x86.Build.0 = Release|Any CPU
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Debug|Any CPU.ActiveCfg = Debug|x64
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Debug|x64.ActiveCfg = Debug|x64
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Debug|x64.Build.0 = Debug|x64
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Debug|x86.ActiveCfg = Debug|Win32
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Debug|x86.Build.0 = Debug|Win32
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Release|Any CPU.ActiveCfg = Release|x64
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Release|x64.ActiveCfg = Release|x64
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Release|x64.Build.0 = Release|x64
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Release|x86.ActiveCfg = Release|Win32
-		{B63F2E01-5157-4719-8491-0E1C7CD3B701}.Release|x86.Build.0 = Release|Win32
 		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Debug|x64.Build.0 = Debug|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Debug|x86.Build.0 = Debug|Any CPU
 		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Release|x64.ActiveCfg = Release|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Release|x64.Build.0 = Release|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Release|x86.ActiveCfg = Release|Any CPU
-		{F4A69E2D-908E-4F0F-A794-84D508D60E5F}.Release|x86.Build.0 = Release|Any CPU
 		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Debug|x64.Build.0 = Debug|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Debug|x86.Build.0 = Debug|Any CPU
 		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Release|x64.ActiveCfg = Release|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Release|x64.Build.0 = Release|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Release|x86.ActiveCfg = Release|Any CPU
-		{27F7F3C6-BDDE-43A9-B565-856F8395A04B}.Release|x86.Build.0 = Release|Any CPU
 		{069FA680-3C4D-43A9-B84F-E67513B87827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{069FA680-3C4D-43A9-B84F-E67513B87827}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Debug|x64.Build.0 = Debug|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Debug|x86.Build.0 = Debug|Any CPU
 		{069FA680-3C4D-43A9-B84F-E67513B87827}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{069FA680-3C4D-43A9-B84F-E67513B87827}.Release|Any CPU.Build.0 = Release|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Release|x64.ActiveCfg = Release|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Release|x64.Build.0 = Release|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Release|x86.ActiveCfg = Release|Any CPU
-		{069FA680-3C4D-43A9-B84F-E67513B87827}.Release|x86.Build.0 = Release|Any CPU
 		{DFB08363-202E-412D-8812-349EF10A8702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{DFB08363-202E-412D-8812-349EF10A8702}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Debug|x64.Build.0 = Debug|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Debug|x86.Build.0 = Debug|Any CPU
 		{DFB08363-202E-412D-8812-349EF10A8702}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DFB08363-202E-412D-8812-349EF10A8702}.Release|Any CPU.Build.0 = Release|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Release|x64.ActiveCfg = Release|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Release|x64.Build.0 = Release|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Release|x86.ActiveCfg = Release|Any CPU
-		{DFB08363-202E-412D-8812-349EF10A8702}.Release|x86.Build.0 = Release|Any CPU
 		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Debug|x64.Build.0 = Debug|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Debug|x86.Build.0 = Debug|Any CPU
 		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Release|Any CPU.Build.0 = Release|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Release|x64.ActiveCfg = Release|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Release|x64.Build.0 = Release|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Release|x86.ActiveCfg = Release|Any CPU
-		{8F507DBE-56F9-437F-82D4-74C02EC44E41}.Release|x86.Build.0 = Release|Any CPU
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Any CPU.ActiveCfg = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x86.ActiveCfg = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x86.Build.0 = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Any CPU.ActiveCfg = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x86.ActiveCfg = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x86.Build.0 = Release|Win32
 		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Debug|x64.Build.0 = Debug|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Debug|x86.Build.0 = Debug|Any CPU
 		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Release|Any CPU.Build.0 = Release|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Release|x64.ActiveCfg = Release|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Release|x64.Build.0 = Release|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Release|x86.ActiveCfg = Release|Any CPU
-		{5B571661-17F4-4F29-8C7D-0EDB38CA9B55}.Release|x86.Build.0 = Release|Any CPU
 		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Debug|x64.Build.0 = Debug|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Debug|x86.Build.0 = Debug|Any CPU
 		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Release|Any CPU.Build.0 = Release|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Release|x64.ActiveCfg = Release|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Release|x64.Build.0 = Release|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Release|x86.ActiveCfg = Release|Any CPU
-		{13EA96FC-CC83-4164-A7C0-4F30ED797460}.Release|x86.Build.0 = Release|Any CPU
 		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Debug|x64.Build.0 = Debug|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Debug|x86.Build.0 = Debug|Any CPU
 		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Release|x64.ActiveCfg = Release|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Release|x64.Build.0 = Release|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Release|x86.ActiveCfg = Release|Any CPU
-		{18EA4C71-A11D-4AB1-8042-418F7559D84F}.Release|x86.Build.0 = Release|Any CPU
 		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Debug|x64.Build.0 = Debug|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Debug|x86.Build.0 = Debug|Any CPU
 		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Release|x64.ActiveCfg = Release|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Release|x64.Build.0 = Release|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Release|x86.ActiveCfg = Release|Any CPU
-		{C6B58E4A-A2E9-4554-AD02-68CE6DA5CFB7}.Release|x86.Build.0 = Release|Any CPU
 		{6F82D669-382E-4435-8092-68C4440146D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{6F82D669-382E-4435-8092-68C4440146D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Debug|x64.Build.0 = Debug|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Debug|x86.Build.0 = Debug|Any CPU
 		{6F82D669-382E-4435-8092-68C4440146D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{6F82D669-382E-4435-8092-68C4440146D8}.Release|Any CPU.Build.0 = Release|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Release|x64.ActiveCfg = Release|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Release|x64.Build.0 = Release|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Release|x86.ActiveCfg = Release|Any CPU
-		{6F82D669-382E-4435-8092-68C4440146D8}.Release|x86.Build.0 = Release|Any CPU
 		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Debug|x64.Build.0 = Debug|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Debug|x86.Build.0 = Debug|Any CPU
 		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Release|x64.ActiveCfg = Release|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Release|x64.Build.0 = Release|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Release|x86.ActiveCfg = Release|Any CPU
-		{C558518A-C1A0-4224-AAA9-A8688474B4DC}.Release|x86.Build.0 = Release|Any CPU
 		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Debug|x64.Build.0 = Debug|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Debug|x86.Build.0 = Debug|Any CPU
 		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Release|x64.ActiveCfg = Release|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Release|x64.Build.0 = Release|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Release|x86.ActiveCfg = Release|Any CPU
-		{CDA5700E-78F3-4A9E-A9B0-704CBE94651C}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs b/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
index 5703aa6..6d8aa6b 100644
--- a/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
@@ -22,6 +22,7 @@ namespace Apache.Ignite
     using System.Configuration;
     using System.Linq;
     using System.ServiceProcess;
+    using System.Threading;
     using Apache.Ignite.Config;
     using Apache.Ignite.Core;
     using Apache.Ignite.Core.Impl;
@@ -97,9 +98,12 @@ namespace Apache.Ignite
                         IgniteService.DoInstall(allArgs);
                     else
                     {
-                        Ignition.Start(Configurator.GetConfiguration(allArgs));
+                        var ignite = Ignition.Start(Configurator.GetConfiguration(allArgs));
 
-                        IgniteManager.DestroyJvm();
+                        // Wait until stopped.
+                        var evt = new ManualResetEventSlim(false);
+                        ignite.Stopped += (s, a) => evt.Set();
+                        evt.Wait();
                     }
 
                     return;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec38564a/modules/platforms/dotnet/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/DEVNOTES.txt b/modules/platforms/dotnet/DEVNOTES.txt
index df0ebb5..db5bc6c 100644
--- a/modules/platforms/dotnet/DEVNOTES.txt
+++ b/modules/platforms/dotnet/DEVNOTES.txt
@@ -6,7 +6,7 @@ Requirements:
 * Oracle JDK 7 and above
 * .NET Framework 4.0
 * PowerShell 3.0+
-* Visual Studio 2010 (later versions require upgrading "common" C++ project, see below)
+* Visual Studio 2010+
 * JAVA_HOME environment variable set to the corresponding JDK (x64 or x86)
 * Apache Maven bin directory in PATH, or MAVEN_HOME environment variable
 
@@ -15,15 +15,4 @@ Building binaries:
 Resulting binaries will be in bin folder, and NuGet packages in nupkg folder.
 
 Running built binaries: resulting "bin" folder in self contained, you can copy it anywhere and run
-  bin\Apache.Ignite.exe  
-
-NOTE: 
-* x86 solution platform requires x86 Oracle JDK.
-* x64 solution platform requires x64 Oracle JDK.
-* AnyCPU platform requires at least one of the above. 
-To build truly universal AnyCPU binaries (suitable for x86 and x64 modes), both x64 and x86 Oracle JDKs should be installed.
-
-Building in later versions of Visual Studio:
-* Open Apache.Ignite.sln in Visual Studio
-* You will be prompted to "Update VC++ Compiler and Libraries", click "Update"
-* OR, right-click "common" project in the Solution Explorer and select "Upgrade VC++ Compiler and Libraries"
\ No newline at end of file
+  bin\Apache.Ignite.exe  
\ No newline at end of file