This is a migrated thread and some comments may be shown as answers.

ImportCardinalityMismatchException with FiddlerCore .NET standard beta

1 Answer 275 Views
FiddlerCore
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 13 Sep 2019, 02:18 PM

Hello,

 

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

1 Answer, 1 is accepted

Sort by
0
Simeon
Telerik team
answered on 23 Sep 2019, 11:27 PM

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.

Regards,
Simeon
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
Tags
FiddlerCore
Asked by
Julian
Top achievements
Rank 1
Answers by
Simeon
Telerik team
Share this question
or