mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
TinyMapper error #530
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rmeshksar on GitHub (Jul 19, 2023).
Originally assigned to: @StefH on GitHub.
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:
@StefH commented on GitHub (Jul 19, 2023):
Can you please provide a full working solution / project to show this error?
@rmeshksar commented on GitHub (Jul 20, 2023):
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:
Now when I am making a GET request:
It throws error which I mentioned.
@StefH commented on GitHub (Jul 20, 2023):
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
@rmeshksar commented on GitHub (Jul 21, 2023):
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.
@StefH commented on GitHub (Jan 6, 2024):
https://github.com/WireMock-Net/WireMock.Net/pull/1051
@StefH commented on GitHub (Jan 8, 2024):
@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)
@StefH commented on GitHub (May 17, 2025):
https://github.com/wiremock/WireMock.Net/pull/1299
@StefH commented on GitHub (May 17, 2025):
@rmeshksar
Can you try preview version:
1.8.6-ci-110058?(https://github.com/wiremock/WireMock.Net/wiki/MyGet-preview-versions)