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
gemhost_csharp_example [2020/05/12 18:39]
wikiadmin
gemhost_csharp_example [2023/03/14 21:40] (current)
wikiadmin
Line 4: Line 4:
  
 Once you have this SECS/GEM model, you can deploy it with one-button push to a .NET assembly.  The assembly name follows the name of the tool, so here GEMTool.dll. Including that in your project gives you access to all the features of the SECS/GEM model. Once you have this SECS/GEM model, you can deploy it with one-button push to a .NET assembly.  The assembly name follows the name of the tool, so here GEMTool.dll. Including that in your project gives you access to all the features of the SECS/GEM model.
 +
 +**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 GEMHost 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\GEMHostDotNetRuntime.jar"> 
 +<AssemblyName>GEMHostDotNetRuntime</AssemblyName>  
 +
 +If your project was "MySpecialHostProject" and you've again copied the jar to the lib then you'd have this:
 +
 +<IkvmReference Include="lib\MySpecialHostProject.jar"> 
 +<AssemblyName>MySpecialHostProject</AssemblyName>  
 +
 +
 +Here's the detailed steps using the GEMHost 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\GEMHostDotNetRuntime.jar"> 
 +              <AssemblyName>GEMHostDotNetRuntime</AssemblyName> 
 +              <AssemblyVersion>1.0.0.0</AssemblyVersion> 
 +              <AssemblyFileVersion>1.0.0.0</AssemblyFileVersion> 
 +          </IkvmReference> 
 +      </ItemGroup>
 + 
 +* Remember to replace "lib\GEMHostDotNetRuntime.jar" with the path to the generated jar file. You can also change the assembly information as needed.
 +
 +* Save and close the .csproj file.
 +
 +**Sample Host**
  
 The attached example demonstrates a host application.  It is a complete, functioning GEM host. The attached example demonstrates a host application.  It is a complete, functioning GEM host.
  • gemhost_csharp_example.1589326782.txt.gz
  • Last modified: 2020/05/12 18:39
  • by wikiadmin