Use a .NET assembly in a store
The .NET assembly in a store may reference other assemblies. For example, the TADotNetAssembly.dll references the TotalAgility.Sdk.Dll and CommonUtilities.Dll. assemblies.
The referenced assemblies must be merged so that they work as the store assembly.
To merge Microsoft .NET Framework 4.8 assemblies, you can use the .NET utility ILRepack.
For example, to merge assemblies (TotalAgility.Sdk.Dll and CommonUtilities.Dll) into the output assembly (TADotNetAssemblyM.dll) using ILRepack, modify project settings within Visual Studio by including a Post Build Event as follows:
"..\..\ILRepack.exe" "TADotNetAssembly.dll" "CommonUtilities.dll" /out:"Merged\TADotNetAssemblyM.dll" /keyfile:“ILRepack.snk” /wildcards /targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8"
An output or merged assembly, such as TADotNetAssemblyM.dll, is created within the Merged folder.
TotalAgility.SDK.DLL does not need to be merged into the output assembly, as it is picked up automatically by TotalAgility at runtime.
Create a key file using the sn utility available in .NET Framework
- Run a Visual Studio Command Prompt.
- Type sn -k <name of the key file>.snk (for example, sn -k tungsten.snk).
- Open Visual Studio and open the solution.
- Select the project.
- Right-click the selected project and then select Properties.
- Select Signing.
- Select Sign the assembly.
-
On the Choose a strong name key file list, select the file name that is newly created.
The .NET Assembly for a store must have a strong name and a different assembly version each time it is updated in the store.
- Select Save.
Auto incrementing the assembly version
- Open Visual Studio and open the solution.
- Select the project.
- Right-click the selected project and then select Properties > Application > Assembly Information.
-
In the
Assembly version field, enter the version. For example, to start the version, enter
1.0.*.
Alternatively, you can also set the version in the assemblyinfo.cs file.
- Select OK.