Not logged in. · Lost password · Register
Forum: MatriX RSS
runfastman #1
Member for 2 weeks · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Error calling SetLicense in .net core matriX 2.1.0.8
I am trying to update to .net core but now when I call SetLicense I get the error listed below. I tried installing the System.Security.Cryptogropy package but it didn't help.

  1. String lic = @"MyLicense";
  2. Matrix.License.LicenseManager.SetLicense(lic);

(Error)
Message=Could not load type 'System.Security.Cryptography.MD5Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  Source=Matrix
  StackTrace:
   at Matrix.Util.Hash.Md5HashBytes(Byte[] pass)
   at Matrix.License.License.Validate()
   at Matrix.License.LicenseManager.SetLicense(String lic)
This post was edited 2 times, last on 2020-11-14, 10:08 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4380 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
For net core there is Matrix vNext.
Matrix is not tested and certified for net core usage.

Are you developing on Windows?
There is also a  System.Security.Cryptography.Cng nuget package.

Same crypto classes are required later as well during XMPP authentication. The are not only used for licensing.

Alex
runfastman #3
Member for 2 weeks · 4 posts
Group memberships: Members
Show profile · Link to this post
I assumed because Nuget package allowed the install, that it was good. I did install the System.Security.Cryptography.Cng nuget package when using the Matrix package. Everything I tested seems to work after I click the continue with demo.

Is there an easy way to convert from Matrix to Matrix.vNet? If I remove the old and install the new, it looks like the current structuring and types are no longer valid.

Yes, I am developing in windows, but most solving such features will have a Linux/Mac options. I would prefer messaging features available as well, but not required.
Avatar
Alex #4
Member since Feb 2003 · 4380 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by runfastman:
I assumed because Nuget package allowed the install, that it was good. I did install the System.Security.Cryptography.Cng nuget package when using the Matrix package. Everything I tested seems to work after I click the continue with demo.

Does this mean everything is working now fine after you added the System.Security.Cryptography.Cng Nuget package?

Quote by runfastman:
Is there an easy way to convert from Matrix to Matrix.vNet? If I remove the old and install the new, it looks like the current structuring and types are no longer valid.
no there is not easy way. The design and API of MatriX vNext is very different from the prior version. Its Reactive and not event based.

Alex
runfastman #5
Member for 2 weeks · 4 posts
Group memberships: Members
Show profile · Link to this post
Does this mean everything is working now fine after you added the System.Security.Cryptography.Cng Nuget package?

No, I still get the error on SetLicense, but if I take this out and just use "Continue Evaluation" then things seem to work as usual. Installing the System.Security.Cryptography.Cng package didn't make any difference.

Is there a work around to make Matrix to work in .net core?
Avatar
Alex #6
Member since Feb 2003 · 4380 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It would help when you attach a simple test project to this thread which we can use to reproduce then issue.
Can you do this?

Thanks,
Alex
Avatar
Alex #7
Member since Feb 2003 · 4380 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It looks like the MD5Cng class does not exist in .net core. And it also looks like the TypeLoadException is not passed to the code to handle it.

See also: https://apisof.net/catalog/System.Security.Cryptography.MD…

You could try to use MatriX.Mono NuGet package which is using different crypto implementations than the Windows builds.
But keep in mind that also those builds are tested and certified for net core usage by us.
runfastman #8
Member for 2 weeks · 4 posts
Group memberships: Members
Show profile · Link to this post
So this is strange. The .Mono package works great for my server. However the test client never connects using it. This is OK though, I can leave the test client as the normal Matrix package because we use it just for testing and plant give it out, so can't have the license key in it.

Hopefully I will have time/$ to transition to vNet, down the road. Thanks for the help!
Avatar
Alex #9
Member since Feb 2003 · 4380 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • do you have any logs from the client?
  • Is there Xml passing the wire or is the socket never connecting?
  • Can it be a SRV/DNS resolving issue?
  • Have you tried to specify host manual?
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS