-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.MissingMethodException: Cannot dynamically create an instance of type 'Renci.SshNet.Security.KeyExchangeECCurve25519'. Reason: No parameterless constructor defined. #1167
Comments
Are you trimming your application? |
I have some error, how resolve it? |
Yes, if untrimmed app when work fine! |
Another problem, how disable trimming my app if PublishAOT is true?
but no effect. |
I don't know a lot about trimming. I think you may try "rooting" the assembly as described at this link (untested) <ItemGroup>
<TrimmerRootAssembly Include="Renci.SshNet" />
</ItemGroup> You could even try using "descriptors" to preserve just the specific types listed here: SSH.NET/src/Renci.SshNet/ConnectionInfo.cs Lines 344 to 357 in 004b57a
I can't see a way on the library side to mark it as incompatible with trimming, short of fixing the actual problem which is the use of reflection here:
It would probably be fixed by changing |
Thanks for comment! |
Hi guys, what's the root cause?
Version: 2020.0.2
System.MissingMethodException: Cannot dynamically create an instance of type 'Renci.SshNet.Security.KeyExchangeECCurve25519'. Reason: No parameterless constructor defined.
at Renci.SshNet.Session.WaitOnHandle(WaitHandle, TimeSpan)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.CreateAndConnectSession()
The text was updated successfully, but these errors were encountered: