1
|
In order to correctly load the assemblies, all of assemblies from ikvm support libraries must be added to Global Assembly Cache (GAC)
|
2
|
<pre>
|
3
|
for line in $(find /usr/lib/ikvm/ -iname '*.dll'); do
|
4
|
gacutil -i "$line"
|
5
|
done
|
6
|
</pre>
|
7
|
Of course, the script must be executed with root/sudo credentials.
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
Target Runtime: v2.0.50727
|
13
|
==========================
|
14
|
mcs -r:/usr/lib/ikvm/IKVM.OpenJDK.Core.dll -r:bin/p2jpl.dll -target:library -pkg:dotnet -out:bin/P2JLogical.dll src/P2JLogical.cs
|
15
|
mcs -r:/usr/lib/ikvm/IKVM.OpenJDK.Core.dll -r:bin/P2JLogical.dll -pkg:dotnet -target:exe -out:bin/TestApp1.exe src/TestApp1.cs
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22
|
Target Runtime: v4.0.30319
|
23
|
==========================
|
24
|
mono /usr/bin/ikvm/bin/ikvmc.exe -target:library lib/p2jpl.jar -out:bin/p2jpl.dll -version:0.0.1.1 2> p2jpl_conv.log
|
25
|
---------------------------------------------------------------------------------------------------------------------
|
26
|
Version: ea6b3aaa-6e1e-4f1c-a53d-3b1fc9981e47
|
27
|
Location: C:\Work\x-compiled\p2jpl.dll
|
28
|
Size: 1740288 Bytes
|
29
|
Target Runtime: v4.0.30319
|
30
|
Platform Target: Any
|
31
|
|
32
|
|
33
|
@error CS0006: Metadata file `cscompmgd.dll' could not be found@
|
34
|
Manually add the requested assembly:
|
35
|
|
36
|
dmcs -r:/usr/lib/mono/2.0/cscompmgd.dll -r:System.Windows.Forms -r:/usr/lib/ikvm/IKVM.OpenJDK.Core.dll -r:bin/p2jpl.dll -pkg:dotnet -target:library -out:bin/P2JLogical.dll src/P2JLogical.cs src/AssemblyInfo.cs
|
37
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
38
|
Version: 53f5cbab-b91d-4bfb-9959-069746ba62a2
|
39
|
Location: C:\Work\x-compiled\P2JLogical.dll
|
40
|
Size: 5120 Bytes
|
41
|
Target Runtime: v4.0.30319
|
42
|
Platform Target: Any
|
43
|
|
44
|
|
45
|
dmcs -r:/usr/lib/mono/2.0/cscompmgd.dll -r:/usr/lib/ikvm/IKVM.OpenJDK.Core.dll -r:bin/P2JLogical.dll -pkg:dotnet -target:exe -out:bin/TestApp1.exe src/TestApp1.cs
|
46
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
47
|
Version: c36c66d2-4863-4660-9c2a-8cc107364e01
|
48
|
Location: C:\Work\x-compiled\TestApp1.exe
|
49
|
Size: 3584 Bytes
|
50
|
Target Runtime: v4.0.30319
|
51
|
Platform Target: Any
|
52
|
|
53
|
ALTER ASSEMBLY for assembly 'p2jpl' failed because assembly 'p2jpl' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message
|
54
|
[ : com.goldencode.p2j.util.FileChecker::checkFileType][mdToken=0x6001a84][offset 0x00000054] Instruction cannot be verified.
|
55
|
[ : com.goldencode.p2j.util.FileChecker::getFileCreationTime][mdToken=0x6001a86][offset 0x00000054] Instruction cannot be verified.
|
56
|
[ : com.goldencode.p2j.util.LaunchManager::pseudoTerminalWait][mdToken=0x6001bcd][offset 0x0000004E] Instruction cannot be verified.
|
57
|
[ : com.goldencode.p2j.util.LaunchManager::pseudoTerminalLaunch][mdToken=0x6001bcf][offset 0x0000006E] Instruction cannot be verified.
|
58
|
[ : com.goldencode.p2j.util.MemoryManager::isLittleEndian][mdToken=0x6001d04][offset 0x0000004C] Instruction cannot be verified.
|
59
|
[ : com.goldencode.p2j.util.MemoryManager::allocate][mdToken=0x6001d05][offset 0x0000004D] Instruction cannot be verified.
|
60
|
[ : com.goldencode.p2j.util.MemoryManager::deallocate][mdToken=0x6001d06][offset 0x0000004D] Instruction cannot be verified.
|
61
|
[ : com.goldencode.p2j.util.MemoryManager::findNextNull][mdToken=0x6001d07][offset 0x0000004F] Instruction cannot be verified.
|
62
|
[ : com.goldencode.p2j.util.MemoryManager::read][mdToken=0x6001d08][offset 0x00000051] Instruction cannot be verified.
|
63
|
[ : com.goldencode.p2j.util.MemoryManager::write][mdToken=0x6001d09][offset 0x00000056] Instruction cannot be verified.
|
64
|
[ : com.goldencode.p2j.util.MemoryManager::copy][mdToken=0x6001d0a][offset 0x00000050] Instruction cannot be verified.
|
65
|
[ : com.goldencode.p2j.util.Registry::setKeyVal][mdToken=0x6001ff8][offset 0x0000006C] Instruction cannot be verified.
|
66
|
[ : com.goldencode.p2j.util.Registry::removeValueName][mdToken=0x6001ff9][offset 0x00000064] Instruction cannot be verified.
|
67
|
[ : com.goldencode.p2j.util.Registry::removeSubKey][mdToken=0x6001ffa][offset 0x0000005C] Instruction cannot be verified.
|
68
|
[ : ... (Microsoft SQL Server, Error: 6218)
|
69
|
|
70
|
ALTER ASSEMBLY failed because type 'com.goldencode.expr.CompiledExpression' in safe assembly 'p2jpl' has a static field '$assertionsDisabled'. Attributes of static fields in safe assemblies must be marked readonly in Visual C#, ReadOnly in Visual Basic, or initonly in Visual C++ and intermediate language. (Microsoft SQL Server, Error: 6211)
|
71
|
|
72
|
|
73
|
|
74
|
mono --runtime=v2.0.50727 /usr/bin/ikvm/bin/ikvmc.exe -target:library lib/p2jpl.jar -out:bin/p2jpl.dll -version:0.0.1.1 2> p2jpl_conv.log
|
75
|
* will generate Target Runtime: v4.0.30319, too
|
76
|
|
77
|
|
78
|
Target Runtime v2.0.50727 - the default in windows
|
79
|
=========================
|
80
|
mono --runtime=v2.0.50727 /usr/bin/ikvm/bin/ikvmc.exe -target:library -nostdlib -r:/usr/lib/mono/2.0/mscorlib.dll -r:/usr/lib/mono/2.0/System.dll -out:bin/p2jpl.dll -version:0.0.1.1 lib/p2jpl.jar
|
81
|
dmcs -r:/usr/lib/mono/2.0/cscompmgd.dll -r:System.Windows.Forms -r:/usr/lib/ikvm/IKVM.OpenJDK.Core.dll -r:bin/p2jpl.dll -pkg:dotnet -target:library -out:bin/P2JWrapper.dll src/P2JLogical.cs src/P2JInt64.cs src/AssemblyInfo.cs
|
82
|
dmcs -r:/usr/lib/mono/2.0/cscompmgd.dll -r:/usr/lib/ikvm/IKVM.OpenJDK.Core.dll -r:bin/P2JWrapper.dll -pkg:dotnet -target:exe -out:bin/TestApp1.exe src/TestApp1.cs
|
83
|
|
84
|
|
85
|
|
86
|
# after loading the assemblies into SQL, creating table and populating: #
|
87
|
=========================================================================
|
88
|
SELECT [p2j_int64].P2J_Add('10').value(),
|
89
|
[p2j_int64].P2J_Add('-99')
|
90
|
FROM [p2j_wrappers]
|
91
|
-- ERR: More than one method, property or field was found with name 'P2J_Add' in class 'P2JInt64' in assembly 'P2JWrappers'. Overloaded methods, properties or fields are not supported.
|
92
|
|
93
|
|
94
|
|
95
|
|