I ran into the same problem. I came across a small blog post with a solution to a problem that I will cover in my answer. Here is a blog post that I mean: http://blogs.windwardreports.com/davidt/2011/02/calling-j-code-from-net-40.html .
Please note that I can not take credit for this decision. This is a solution that I personally used in my projects.
J # DLL .NET 4.0 vjsnativ.dll . , , . , :
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace Test
{
class Program
{
[DllImport("kernel32", SetLastError = true)]
static extern IntPtr LoadLibrary(string lpFileName);
static void Main(string[] args)
{
if (Environment.Version.Major >= 4)
{
string folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), @"..\Microsoft.NET\Framework\v2.0.50727");
folder = Path.GetFullPath(folder);
LoadLibrary(Path.Combine(folder, "vjsnativ.dll"));
}
}
}
}
: - . , .