I have an Asp.Net Core project where I'm using RavenDB document database. Everything was working fine until I added Metrics.NET (https://github.com/etishor/Metrics.NET) to the project. Since then the following issue is happening when loading the project:
Exception has been thrown by the target of an invocation.
The type initializer for 'Raven.Abstractions.Util.MetricsTicker' threw an exception.
Could not load file or assembly 'metrics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca6c6ef570198eba' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
It seems that RavenDB uses its own metrics.dll that has conflicts with the one from Metrics.Net when the assemblies are loading. Is there any way to resolve this? Does someone has had this issue? Can I say to Nuget or the project that moves the RavenDB assemblies to a subfolder to avoid the conflicts?
I'm using RavenDB version 3.0.30155 and Metrics.Net version 0.3.7 Nugget packages.
Thanks for any help!
So, after more investigation it was an issue on RavenDB. It has an internal custom Metrics.Net library that was what caused the conflict. The issue is here: http://issues.hibernatingrhinos.com/issue/RavenDB-5321
It is fixed in the version 3.0.30156-Hotfix
User contributions licensed under CC BY-SA 3.0