Closed rmeshksar closed 1 month ago
Can you please provide a full working solution / project to show this error?
Here is the project: WireMockIssue.zip
It is a .NET 4.7.1 console application. I just added WireMock.Net from Nuget and wrote this main function:
static void Main(string[] args)
{
WireMockServer.Start(new WireMockServerSettings
{
Port = 8443,
StartAdminInterface = true
});
Console.WriteLine("Press any key to stop the server");
Console.ReadLine();
}
Now when I am making a GET request:
localhost:8443/__admin/settings
It throws error which I mentioned.
I changed to another mapper.
Can you try preview version 1.5.32-ci-17647
?
https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
1.5.32-ci-17647 works fine.
Is there anything can be done for RestEase as well. I had a lot of issues with it and the provided solution did not work for me.
I noticed if I create a console application with .NET 4.7.1 and ONLY install WireMock.Net.RestClient and Brutal.Dev.StrongNameSigner then I still get this error : 'Could not load file or assembly 'RestEase, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'
But if I install WireMock.Net as well this solution works !
In order to solve it for our project: First I got RestEase source code and compiled it with signed mode but that did not work. Then I got the source code of WireMock and removed signed form RestClient project and compiled. This solution worked and it is fine for me for now but not ideal.
@rmeshksar Can you also try this version? 1.5.46-ci-18287
I did replace TinyMapper again with a different Mapper.
(RestEase I'm looking into, but no progress yet)
I created a console application and enabled Admin Interface. Now when I try to use admin API, I am getting this error:
System.TypeInitializationException: The type initializer for 'WireMock.Util.TinyMapperUtils' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'TinyMapper, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required.
It seams the similar issue that is mentioned here: https://github.com/WireMock-Net/WireMock.Net/wiki/Could-not-load-file-or-assembly-RestEase
I added Brutal.Dev.StrongNameSigner to the console application. First I had hard time compiling the project and I had to close and open Visual Studio, and finally when the project got compiled, still I got the same error.
I am using Wiremock .Net 1.5.32
This is the full log: