Author Topic: Client can't interact with WCF-service when it is hosted by accoreconsole.exe  (Read 2079 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Windows 7 x64
Visual Studio 2015 Update 1.
AutoCAD 2016 SP1 x64
.Net Framework 4.6.1

I have a problem when my WCF service is hosted by accoreconsole.exe instead of acad.exe: the client application (the console application) can't interact with it. Both cases servise was opened successfully and telnet works fine with the necessary port. I use HTTP protocol. I haven't this problem when the host is acad.exe (for the same client application).

For this problem demonstration I created the simple solution with two projects: client and service. Detailed info about each of them is discribed in their readme.md files. The problem with screens is described in the readme.md of the solution.

NOTE
It is necessary to read readme.md files, because they contain important info. For building this solution you are to launch Visual Studio with admin rights.

I will be very grateful for the explanation of the reasons of this problem.

Best regards, Andrey.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
I changed the config-files and got the logs of client and service. They can be opened through the Microsoft Service Trace Viewer (GUI application). I see the timeout occurs when client try to call the method GetVersion() of my service interface (when accoreconsole.exe is the host of my service):



I haven't any problem when the host is acad.exe instead of accoreconsole.exe. But I would like to use accoreconsole.exe at this case.
« Last Edit: April 11, 2016, 09:36:14 AM by Andrey Bushman »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Quote from: Augusto Goncalves (API Evangelist at Autodesk)
As far as I remember trying, accoreconsole.exe doesn't accept new calls (from automation) after is open (but I haven't tried with WCF). Acad.exe is a little different... I don't believe accoreconsole will remain receiving calls after it was launched, it was designed to launch with a list of commands on the .scr file.
It is bad. Monolog is finished.

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Your image didn't load for me - 404.
Because I deleted it's content already. Nobody was interested this theme therefore I don't see sense for the existing of that link. Augusto's answer was enough for me.

Have you considered named pipes or something similar?
named pipes can be used only when client and service are on the same machine. I don't want to get such restriction. Now I use HTTP and I'll use HTTPS later.

This is a dump of the links I was saving for later which may, or may not, be useful if you are considering inter-process communication...
I am learning WCF through this book.

Thank you for your links.
« Last Edit: April 15, 2016, 09:44:57 AM by Andrey Bushman »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Hm... This problem is exists for AutoCAD 2016 only. With AutoCAD 2013-2015 I have not this problem. So... accoreconsole.exe of AutoCAD 2016 is written through the ass...

It is possible the same problem will be in newer AutoCAD versions too (AutoCAD 2017 for example)... But I haven't AutoCAD 2017 and therefore I can't check it.
« Last Edit: April 19, 2016, 10:14:16 AM by Andrey Bushman »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
I thought about it...

It is possible that Autodesk did it intentionally (has deleted possibility of a hosting of services in the 2016th accoreconsole.exe) for if not completely to lock (because it isn't possible) then as much as possible to complicate a possibility of use of the tool in a system of service oriented applications. As existence of such opportunity for the some cases can significantly reduce the count of the necessary licenses of AutoCAD at the enterprises where execution of some (even if not all) volume of the work can be automated (i.e. to be done programmatically). The unlimited number of company users at the same time in that case will be able to use one service or a set of services (read as "one license of AutoCAD").

In the light of this I won't be surprised at all if in the future in newer AutoCAD versions  the console application (accoreconsole.exe) will be removed complettely as "superfluous", because even without abbility of the hosting of services it still contains the same "danger" about abbreviation of licenses...

Don't forget that Autodesk wants to cut the same sheep every year now (a new price policy)...
« Last Edit: April 21, 2016, 12:55:04 PM by Andrey Bushman »