Getting errors in project when new the client
dmikov opened this issue · 4 comments
System.TypeLoadException occurred
HResult=0x80131522
Message=Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible.
Source=Consul
StackTrace:
at Consul.ConsulClient..ctor(Action1 configOverride, Action
1 clientOverride, Action`1 handlerOverride)
at Core.ServiceDiscovery.ConsulProvider.get_Client() in C:\Sources\platform-dotnet\Core\ServiceDiscovery\ConsulProvider.cs:line 25
The line 25 is simply var client = new ConsulClient
What recently changed? Is this in a new project on your side? What version of .NET (Framework or Core, versions of what you're trying to run it with)?
Nothing changed. I tried to use it in this particular project and it started to fail on creating of the client. The other project in the same solution have no problems. The 4.6.1 Framework, command line executable is the project properties.
Looks like you hit this: https://github.com/dotnet/corefx/issues/11100 - I'm trying to figure out what changes I can make to fix this on my side but there may be a workaround on your side as well?
Thank you. Force installing System.Net.Http 4.3.2 did the trick. I wonder why web api project (core 1.1) didn't have that problem. But all is great now.