Assembly load issue with WireMock.Net.RestClient on .NET 4.7.2 #279

Closed
opened 2025-12-29 08:25:17 +01:00 by adam · 3 comments
Owner

Originally created by @MissaouiChedy on GitHub (Jun 2, 2020).

I created a .NET 4.7.2 Console application in which I installed with nuget WireMock.Net.RestClient version 1.2.12

I have the following code in my Main method:

// Create an implementation of the IWireMockAdminApi and pass in the base URL for the API.
var api = RestClient.For<IWireMockAdminApi>("http://localhost:8888");

// Call API
var settings = await api.GetSettingsAsync();

The first call that creates an instance of the API fails with the following exception:
System.IO.FileLoadException: 'Could not load file or assembly 'RestEase, Version=1.4.10.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)'

It seems that a strongly named assembly is required for full .NET framework projects.
Any pointers for workarounds or fixes?

Originally created by @MissaouiChedy on GitHub (Jun 2, 2020). I created a .NET 4.7.2 Console application in which I installed with nuget `WireMock.Net.RestClient` version `1.2.12` I have the following code in my `Main` method: ``` cs // Create an implementation of the IWireMockAdminApi and pass in the base URL for the API. var api = RestClient.For<IWireMockAdminApi>("http://localhost:8888"); // Call API var settings = await api.GetSettingsAsync(); ``` The first call that creates an instance of the API fails with the following exception: `System.IO.FileLoadException: 'Could not load file or assembly 'RestEase, Version=1.4.10.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)'` It seems that a strongly named assembly is required for full .NET framework projects. Any pointers for workarounds or fixes?
adam added the question label 2025-12-29 08:25:17 +01:00
adam closed this issue 2025-12-29 08:25:17 +01:00
Author
Owner

@StefH commented on GitHub (Jun 3, 2020):

Can you take a look at https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.Client.Net472 and check the differences?

@StefH commented on GitHub (Jun 3, 2020): Can you take a look at https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.Client.Net472 and check the differences?
Author
Owner

@MissaouiChedy commented on GitHub (Jun 14, 2020):

@StefH Thank you for pointing out the .NET 4.7.2 example.

It seems that I was missing the Brutal.Dev.StrongNameSigner package.

Adding it solves the strong name issue.

@MissaouiChedy commented on GitHub (Jun 14, 2020): @StefH Thank you for pointing out the .NET 4.7.2 example. It seems that I was missing the [`Brutal.Dev.StrongNameSigner`](https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/) package. Adding it solves the strong name issue.
Author
Owner

@StefH commented on GitHub (Jun 15, 2020):

Ok. Good to hear.
There was also a WIKI page about this:
https://github.com/WireMock-Net/WireMock.Net/wiki/Could-not-load-file-or-assembly-RestEase

@StefH commented on GitHub (Jun 15, 2020): Ok. Good to hear. There was also a WIKI page about this: https://github.com/WireMock-Net/WireMock.Net/wiki/Could-not-load-file-or-assembly-RestEase
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#279