In short: There is a web service (ASP.NET, .NET-3.5) and there is a client (WinForms, .NET-4.5). The service has a dll for communicating with 1C via a COM connection. Until I publish the service, the client "communicates" with the service normally (even in Release). But after the service is published on the IIS server, the client cannot process the response from the service.

Throws one such exception: System.ServiceModel.ProtocolException

Additional information: Content type text / html; The charset = utf-8 of the response message does not match the content type of the binding (text / xml; charset = utf-8). When using a special encoder, you must correctly implement the IsContentTypeSupported method.

Unable to load file or assembly "Interop.V83" or one of its dependent components. An attempt was made to download a program that has the wrong format.

On both projects is the ultimate x86 platform. It is impossible to “downgrade” the framework on the client. It is impossible to “uplift” on the service. Adding the same to the client did not help!

How to be?

  • 4.5 library - works fine. - Vasily Khmelenko
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky ♦

1 answer 1

If the server returns text/html; charset=utf-8 text/html; charset=utf-8 - it means something broke there. And so much so that the service did not even try to rise.

Open the URL of the service in the browser and see what the error is.


Error "An attempt was made to load a program that has the wrong format." means the discrepancy of bitness.

Adjust the version of the application pool used to match the version of the library. This is done in the IIS settings, details on the link:

https://stackoverflow.com/a/16232432/4340086

  • I allowed 32 apps in the pool! Now here is an exception: System.ServiceModel.FaultException - Vasily Khmelenko
  • System.Web.Services.Protocols.SoapException: The server was unable to process the request. ---> System.UnauthorizedAccessException: Failure to get the production of COM class objects for a component with CLSID {181E893D-73A4-4722-B61D-D604B3D67D47} as a result of the following error: 80070005. - Vasily Khmelenko
  • in WebService1.V82Connector.V82Connector.Connect1C () in WebService1.Service1..ctor () - Vasily Khmelenko
  • @ Vasily Khmelenko Fault is already an application error. - Pavel Mayorov
  • @ Vasily Khmelenko, firstly, this is a completely different problem - and secondly, somewhere it has already been solved. Search. - Pavel Mayorov