gemtool_csharp_example

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
gemtool_csharp_example [2021/09/24 12:02]
wikiadmin
gemtool_csharp_example [2023/09/13 12:29] (current)
wikiadmin
Line 6: Line 6:
  
 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. 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.
 +
 +**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.
 +
  
 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.
  • gemtool_csharp_example.1632502932.txt.gz
  • Last modified: 2021/09/24 12:02
  • by wikiadmin