G
G
George62019-05-22 23:29:16
Mono
George6, 2019-05-22 23:29:16

Error when starting TypeLoadExeption - how to solve?

There is such an error when running one example of interest to me from MSDN.
The error itself (console output):

spoiler
Unhandled Exception:
System.TypeLoadException: Could not resolve type with token 0100000e from typeref (expected class 'System.Security.Cryptography.ECDiffieHellmanCng' in assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not resolve type with token 0100000e from typeref (expected class 'System.Security.Cryptography.ECDiffieHellmanCng' in assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')

Link to sample code on MSDN:
https://docs.microsoft.com/en-us/dotnet/api/system...

I was looking for solutions on Russian-language resources, on English-speaking ones - most of all, the degree of desperation reflects the question of a person on StackOverflow
https://stackoverflow.com/questions/56103758/getti...

There are many solutions here as well. Their range is amazing - from "delete the obj and bin folders and rebuild the project" to "mono will die soon, install windows and vs". And the solutions helped someone. But not to me.
MonoDevelop version 7.8.2 (build 2), Linux Mint OS version 19.1 Tessa, it seems that the code was already launched with all .NET versions available in the IDE, but things are still there - the error looks the same in any case. Regular programs like "hello world!" or homemade classes work without problems, problems start when using built-in classes - in particular System.Security.Cryptography.ECDiffieHellmanCng. The point is somewhere in System.Core, something does not see it, or sees it wrong - but what exactly is the matter and how to solve the problem, I still did not understand.
Who faced similar, how it turned out to solve?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2019-05-23
@George6

Wait until CoreFX System.Security.Cryptography functionality is implemented in Mono.
https://github.com/mono/mono/issues/9463

S
shai_hulud, 2019-05-24
@shai_hulud

I recommend https://github.com/bcgit/bc-csharp
because this is a port, then all the docks are in the java version, but there is almost everything you might need in cryptography + a nice bonus in the form of TLS and DTLS implementation. Will work on all platforms from .NET 1.1 (including mono).
For the bloody enterprise, there is cryptolab certification and a FIPS compliant version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question