Share via

Microsoft.AspNet.Core InvalidOperationException

Neil Glastonbury 1 Reputation point
2020-12-01T10:45:36.897+00:00

I've followed James Montemagno's Real Time Communication for Mobile with SignalR which works great until I select Linking: Sdk and User Assembilies. After that I get: a suitable constructor for type 'Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory' could not be located.
I've tried skip linking via Option, linking.config file and Runtime.Preserve but same error.
Is there a way to skip linking for AspNetCore or another way to resolve this error please?

Developer technologies | .NET | Xamarin

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,971 Reputation points
    2020-12-02T08:56:00.067+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    1. It's recommend to use Link SDK Assemblies Only as it is the safest and easiest to understand. The difference between the two in terms of application size is usually minimal and often when linking everything you can get in trouble as the linker can be aggressive and will remove more than needed, especially if you use reflection.
    2. To preserve the assembily, please make sure the steps are all correct. You could refer to the tutorial: https://learn.microsoft.com/en-us/xamarin/android/deploy-test/linker#preserving-code

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.