Last post May 07, 2020 09:27 AM by PrimeNum
Feb 15, 2019 03:04 PM|dashgir|LINK
I have a dotnet core 2.0 app which makes some calls out to some 3rd party soap services. The web references have been added to the project using a wsdl and connected services. Everything works fine but periodically it stops working and throws an error.
Type 'generatedProxy_2' from assembly 'ProxyBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.
System.TypeLoadException: Type 'generatedProxy_2' from assembly 'ProxyBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.
at SoapClient.GetDetailsAsync(GetDetailsRequest request) in Connected Services\SoapClient\Reference.cs:line 1146
This api runs on linux container and when i restart the api the error goes away and everything runs fine. There is no issue on the service side because the method it calls exists. Web reference has been updated to the latest. There is no outgoing call from
the api when this error occurs.
Any help in debugging or fixing this issue?
Feb 18, 2019 06:44 AM|Edward Z|LINK
Could you share us your generated "Reference.cs"?
Based on this error message, it seems the service interface is defined as "internal" or "private". Try to define it as public.
For more information, check this link
#Weird TypeLoadException that only shows up in UWP?
Feb 21, 2019 02:22 AM|dashgir|LINK
I came across that thread, but it has not helped. The reference.cs has been auto generated and the particular method being called is already public. It mostly works. When I get the error the only solution seems to be to restart the api.
Feb 25, 2019 07:45 AM|Edward Z|LINK
For the error message, it seems to be related with generated Reference. But you have checked and it has been public.
Is there any demo to reproduce your issue?
May 07, 2020 09:27 AM|PrimeNum|LINK
I don't know if it still relevant, but recently I had the same problem, when changed Connected Service (WCF) converted modifier from Public To Internal
In my case the solution was adding
I'm using asp.net core 3.1 with VS 2019. Reference.cs generated with