Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gemtool_csharp_example [2020/05/12 18:37]
wikiadmin
gemtool_csharp_example [2023/09/13 12:29] (current)
wikiadmin
Line 1: Line 1:
-This CSharp Java example uses the code generated from TransSECS using the .net deployment option. To prepare for this example, please load the [[GEMHost Sample Project]] and generate the code so that TransSECS Builder in run/test mode can be used as a test Host.+This CSharp example uses the code generated from TransSECS using the .NET deployment option.
  
 1. Start TransSECS and load the [[GEMTool Sample Project]]. Generate the code with the .net option selected for deployment.  1. Start TransSECS and load the [[GEMTool Sample Project]]. Generate the code with the .net option selected for deployment. 
  
-2. The .net assembly (GEMTool.dll) which is needed for the CSharp example is in the project (GEMTool) directory under DOTNET.+2. The .net assembly (GEMTool.dll) which is needed for the CSharp example is in the project (GEMTool) directory under DOTNET.  Some additional assemblies are required - see below.
  
-3. Other required libraries are copied to your DOTNET project directory under the "bin" folder. You will need these libraries to build the csharp code.+To prepare for testing this example, please load the SECSTester provided with TransSECS or load [[GEMHost Sample Project]] and generate the code so that TransSECS Builder in run/test mode can be used as a test Host.
  
-A list of the most likely required libraries are:+**One-time .NET Project Setup** 
 + 
 +When you first create your project you will need to modify your .csproj to include the TransSECS generated jar.  You need to modify the ItemGroup to include the generated .jar file Reference and AssemblyName. 
 + 
 +The names should follow your TransSECS project name, so if you're using the GEMTool sample project included with TransSECS and you have copied that jar in the lib folder of your project then you may have a lines like this: 
 +  
 +<IkvmReference Include="lib\GEMToolDotNetRuntime.jar">  
 +<AssemblyName>GEMToolDotNetRuntime</AssemblyName>   
 + 
 +If your project was "MySpecialToolProject" and you've again copied the jar to the lib then you'd have this: 
 + 
 +<IkvmReference Include="lib\MySpecialToolProject.jar">  
 +<AssemblyName>MySpecialToolProject</AssemblyName>   
 + 
 + 
 +Here's the detailed steps using the GEMTool sample project as an example: 
 + 
 +* Open a command prompt or PowerShell window. 
 +    
 +* Navigate to your project directory. 
 +    
 +* Run the following commands: 
 +    
 +       dotnet add package IKVM 
 +       dotnet add package IKVM.Image.JRE 
 +    
 +* Open your project's .csproj file in a text editor; you should see the following lines (your IKVM version can be different): 
 +        
 +       <ItemGroup> 
 +           <PackageReference Include="IKVM" Version="8.4.5" /> 
 +           <PackageReference Include="IKVM.Image.JRE" Version="8.4.5" /> 
 +       </ItemGroup> 
 +    
 +* Add the following lines to your .csproj file: 
 +       
 +      <ItemGroup>  
 +          <IkvmReference Include="lib\GEMToolDotNetRuntime.jar">  
 +              <AssemblyName>GEMToolDotNetRuntime</AssemblyName>  
 +              <AssemblyVersion>1.0.0.0</AssemblyVersion>  
 +              <AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>  
 +          </IkvmReference>  
 +      </ItemGroup> 
 +  
 +* Remember to replace "lib\GEMToolDotNetRuntime.jar" with the path to the generated jar file. You can also change the assembly information as needed. 
 + 
 +* Save and close the .csproj file.
  
-IKVM.Runtime.dll,IKVM.Reflection.dll,IKVM.OpenJDK.Beans.dll,IKVM.OpenJDK.SwingAWT.dll,IKVM.OpenJDK.XML.Bind.dll,IKVM.OpenJDK.XML.API.dll,IKVM.OpenJDK.XML.Parse.dll,IKVM.OpenJDK.Security.dll,IKVM.Runtime.JNI.dll,IKVM.OpenJDK.Core.dll,IKVM.OpenJDK.Util.dll,IKVM.OpenJDK.Naming.dll,IKVM.OpenJDK.Misc.dll,IKVM.OpenJDK.Text.dll, and IKVM.Runtime.dll 
  
 In the sample code below the tool is initialized, a "notifier" is set up to capture and handle a message from the host (the host command), and then it starts a timed loop to change some vid values while it waits for incoming host messages. In the sample code below the tool is initialized, a "notifier" is set up to capture and handle a message from the host (the host command), and then it starts a timed loop to change some vid values while it waits for incoming host messages.
Line 296: Line 340:
 </code> </code>
  
 +
 +Required libraries are copied to your DOTNET project directory under the "bin" folder. You will need these libraries to build the csharp code.
 +
 +A list of the most likely required libraries are:
 +
 +IKVM.Runtime.dll,IKVM.Reflection.dll,IKVM.OpenJDK.Beans.dll,
 +IKVM.OpenJDK.SwingAWT.dll,IKVM.OpenJDK.XML.Bind.dll,
 +IKVM.OpenJDK.XML.API.dll,IKVM.OpenJDK.XML.Parse.dll,
 +IKVM.OpenJDK.Security.dll,IKVM.Runtime.JNI.dll,
 +IKVM.OpenJDK.Core.dll,IKVM.OpenJDK.Util.dll,
 +IKVM.OpenJDK.Naming.dll,IKVM.OpenJDK.Misc.dll,
 +IKVM.OpenJDK.Text.dll, and IKVM.Runtime.dll
  
  • gemtool_csharp_example.1589326650.txt.gz
  • Last modified: 2020/05/12 18:37
  • by wikiadmin