4

I have this WCF service hosted on IIS. When I try to consume it in my client project using below code I get following exception "An error occurred while sending the request"

LaunchService.LaunchServiceClient launchServiceClient =
            new LaunchService.LaunchServiceClient(
            new BasicHttpBinding(),
            new EndpointAddress("http:// Service base address"));

If I change BasicHttpBinding() to WebHttpBinding() in above code(as in my web.config file) I get this error

"System.TypeLoadException: 'Could not load type 'System.ServiceModel.WebHttpBinding' from assembly 'System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.'"

When using default constructor, I get this error

"System.PlatformNotSupportedException: 'Configuration files are not supported. "

LaunchService.LaunchServiceClient launchService = new LaunchService.LaunchServiceClient();

I tried changing setting in web config file, but any changes in it wont make the service work.

Any help?

Thanks in advance..

Abhishek kumar
  • 4,347
  • 8
  • 29
  • 44
tanvi
  • 41
  • 1
  • 5
  • I was receiving the "System.PlatformNotSupportedException: 'Configuration files are not supported." and it was due to having accidently included a .net core library in my .net framework project via nuget. I had to edit he project file to remove it. – Michael Mar 09 '21 at 22:15

1 Answers1

-2

I got this issue when i added a reference of .net project ('which has the service') in my core project

solution : remove .net project and add new core project

note : some implementation must be modified when initializing the service

Abdullah Tahan
  • 1,963
  • 17
  • 28