iLogic issue with System.Security.Cryptography in Inventor 2025

iLogic issue with System.Security.Cryptography in Inventor 2025

WouterBreedveld
Contributor Contributor
340 Views
1 Reply
Message 1 of 2

iLogic issue with System.Security.Cryptography in Inventor 2025

WouterBreedveld
Contributor
Contributor

The following function worked without any issues in 2024.

 

''' <summary>
''' Returns the MD5 hash from the input.
''' </summary>
''' <param name="strToHash">Input string</param>
''' <returns></returns>
Public Shared Function ComputeMD5Hash(ByVal strToHash As String) As String
	Dim md5Obj As New System.Security.Cryptography.MD5CryptoServiceProvider()
	Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
	bytesToHash = md5Obj.ComputeHash(bytesToHash)
	Dim strResult As String = ""
	Dim b As Byte
	For Each b In bytesToHash
		strResult += b.ToString("x2")
	Next
	Return strResult
End Function

 

Now in 2025.0 and 2025.1 I'm getting the following error:

Error on Line 2343 : Type 'System.Security.Cryptography.MD5CryptoServiceProvider' in assembly 'Rule_ff4b5d2c-5e97-48c2-a624-4c1db448720e.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' has been forwarded to assembly 'System.Security.Cryptography, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Either a reference to 'System.Security.Cryptography, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is missing from your project or the type 'System.Security.Cryptography.MD5CryptoServiceProvider' is missing from assembly 'System.Security.Cryptography, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

 

Can someone share some insight on how to fix this? I tried playing around with different "Imports" but to no avail...

Regards,
Wouter Breedveld
PDM Consultant
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Accepted solutions (1)
341 Views
1 Reply
Reply (1)
Message 2 of 2

WouterBreedveld
Contributor
Contributor
Accepted solution

Okay. I just solved this one minute after posting... 😅

Turns out you have to add a reference in 2025.

AddReference "System.Security.Cryptography"

 

Regards,
Wouter Breedveld
PDM Consultant
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes