ImportCardinalityMismatchException with FiddlerCore .NET standard beta

2 posts, 0 answers
  1. Julian
    Julian avatar
    1 posts
    Member since:
    Sep 2019

    Posted 13 Sep 2019 Link to this post



    I am trying to use the .NET Standard beta of fiddlercore. A very simple test application results in the following error:



    Unhandled Exception: System.ComponentModel.Composition.ImportCardinalityMismatchException: No exports were found that match the constraint:
            ContractName    Telerik.NetworkConnections.NetworkConnectionsManager
            RequiredTypeIdentity    Telerik.NetworkConnections.NetworkConnectionsManager
       at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
       at Fiddler.Proxy..ctor(Boolean , ProxySettings ) in C:\JenkinsHome\jobs\FiddlerCoreForNetStandardReleaseBuild\workspace\Fiddler2\Common\Core\Proxy.cs:line 208
       at Fiddler.FiddlerApplication.Startup(FiddlerCoreStartupSettings startupSettings) in C:\JenkinsHome\jobs\FiddlerCoreForNetStandardReleaseBuild\workspace\Fiddler2\Common\FiddlerApplication.cs:line 732



    I have added all the FiddlerCore nuget packages and ensured that Telerik.NetworkConnections.dll and Telerik.NetworkConnections.Windows.dll are present in the application directory. I also have cleared the ComponentCache for Visual Studio.


    Please advise.


    Kind regards

  2. Simeon
    Simeon avatar
    245 posts

    Posted 23 Sep 2019 Link to this post

    Hi Julian,

    I suppose that your test application is a .NET Core app and you are trying to run it in a Debug or Release configuration. Despite that you are copying the Telerik.NetworkConnections*.dll-s in the application directory, the default behavior of .NET Core CLR is to load the dll-s from %USERPROFILE%\.nuget\packages\ directory.

    If you publish your application, then you should be able to run it.

    However, if you want to be able run your application in a Debug or Release configuration without publishing you will have to add the <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> property in your csproj file.

    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top