How to Reference Custom DLL from Server Method
Copy
You want to reference a custom library from inside an Aras Innovator Server Method.
Technique
Create a custom DLL that references the IOM. This DLL is then added to the BIN folder and referenced in the method-config.xml, allowing it to be called from a server-side method.
Referencing the IOM SDK
Your DLL must reference an IOM version compatible with the Aras Innovator instance where it will run.
Since IOM SDK is now released independently from Aras Innovator, there is no longer a 1:1 mapping between IOM and Innovator versions. However, each Aras Innovator release includes and uses a specific version of the IOM SDK in its Server Methods. Your custom DLL must be compatible with the version of IOM used by the target Aras Innovator release.
How to get the correct IOM version:
By using the version of IOM.dll bundled in the /Innovator/Server/bin folder of the installed Innovator instance — this can help you identify the exact IOM SDK version used.
Create the Custom DLL
To create the custom DLL, it is necessary to
- create a Visual Studio C# class library project using .NET 6.0.
- Add a reference to the IOM.dll (see Referencing the IOM SDK for details).
Class Code
namespace CookBookCustomDLL
{
public class CustomDLLFunct
{
public static string returnUser(Innovator inn)
{
string userID = inn.getUserID();
return userID;
}
}
}
Code tree setup with new DLL
Once you have created the DLL and built the assembly, you need to use the following steps to add the DLL to your Aras Innovator code tree
- Copy the CookBookCustomDLL.dll and CookBookCustomDLL.pdb into the \Innovator\Server\bin folder.
Open the \Innovator\Server\Method-Config.xml for editing and add the highlighted line.
...
<ReferencedAssemblies>
<name>$(binpath)/Aras.Server.Core.dll</name>
<name>$(binpath)/Aras.TDF.Base.dll</name>
<name>$(binpath)/Aras.TDF.Base.Extensions.dll</name>
<name>$(binpath)/Conversion.Base.dll</name>
<name>$(binpath)/ConversionManager.dll</name>
<name>$(binpath)/FileExchangeService.dll</name>
<name>$(binpath)/IOM.dll</name>
<name>$(binpath)/Newtonsoft.Json.dll</name>
<name>$(binpath)/SixLabors.ImageSharp.dll</name>
<name>$(binpath)/Microsoft.Data.SqlClient.dll</name>
<name>Microsoft.Extensions.Logging.Abstractions.dll</name>
<name>$(binpath)/CookBookCustomDLL.dll</name>
...
Search for the
<Template>tag for the language you are using and include the additional namespace you need by adding additional “using” lines.When adding lines, make sure you update the line_number_offset for accurate debugging messages.
<Template name="CSharp” line_number_offset="37"><![CDATA[using System;…using CookBookCustomDLL;- Save the Method-Config.xml
Call new DLL from Innovator Server method.
Code snippet that can be used as a reference for how to call your assembly and function.
Code Snippet
Innovator inn = this.getInnovator();
string userID = CustomDLLFunct.returnUser(inn);