Problem with Apprentice Server when migrating from Inventor 2017 to Inventor 2021

Problem with Apprentice Server when migrating from Inventor 2017 to Inventor 2021

Anonymous
Not applicable
1,583 Views
6 Replies
Message 1 of 7

Problem with Apprentice Server when migrating from Inventor 2017 to Inventor 2021

Anonymous
Not applicable

We've built an Inventor Plugin which works under Inventor 2017. Now we want to migrate to Inventor 2021, which seems to work until we use Apprentice Server from the plugin. The exception we get when initializing Apprentice Server is:

 

System.ArgumentException: 'Retrieving the COM class factory for component with CLSID {C343ED84-A129-11D3-B799-0060B0F159EF} failed due to the following error: 80070057 The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).'

 

The exception is thrown at the following line:

 

var app = new ApprenticeServerComponent();

 

We made two test projects to see where and why to problem occurs. One project accesses Apprentice Server from a regular console app (so it is not an Inventor plugin) and one project is an Inventor plugin that accesses Apprentice Server. The former project works perfectly, the latter gets the exception shown above. Both projects are included in the attached zip.

 

What is going wrong and how can we solve this?

0 Likes
Accepted solutions (1)
1,584 Views
6 Replies
Replies (6)
Message 2 of 7

johnsonshiue
Community Manager
Community Manager

Hi! I would like to double-check and see if the Apprentice server has been installed. Inventor 2021 does not include Apprentice server in the install by default. You will need to download and install it separately. Please take a look at the following page.

 

https://knowledge.autodesk.com/support/inventor/downloads/caas/downloads/content/inventor-apprentice...

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks for the quick response!

 

I've installed the Inventor Apprentice Server 2021 from the link and this does not seem to change the situation. Do note that in the console application Apprentice Server does work (also before the installation). The exception only occurs when Apprentice Server is initialized from our Inventor plugin.

 

We also did a test with a clean Windows 10 machine and a new install of Inventor 2021, where we have the same results, so we can easily reproduce the situation. This install does include Apprentice Server, since the console application does work here as well.

0 Likes
Message 4 of 7

JaneFan
Autodesk
Autodesk

Hi @Anonymous , 

 

Please check whether build platform target of solution is set to X64: 

build.png




Jane Fan
Inventor/Fusion QA Engineer
Message 5 of 7

Anonymous
Not applicable

Hi @JaneFan,

 

Thanks for the reply.

 

We indeed switched both solutions to x64. When running on x86, you do get an exception, but it is a different exception. 

0 Likes
Message 6 of 7

ruthsteed
Autodesk
Autodesk
Accepted solution

Hi. I'm sorry, but using Apprentice Server inside of Inventor has never really been supported, but it wasn't blocked until a couple of years ago. That's why your plugin returns an error when trying to instantiate an instance of it, but your application doesn't. Can I ask what you need from Apprentice that you can't do with regular Inventor APIs?

Regards,

-Ruth Steed, Inventor Development



Ruth Steed
Inventor Development Team
Autodesk, Inc.

Message 7 of 7

Anonymous
Not applicable

Hi @ruthsteed,

 

It is unfortunate that this feature is now blocked. We were already building a solution where we move the apprentice server logic out of process (so out of the plugin). I guess we were on the right track there.

 

We used apprentice server for changing properties in assemblies or parts that are not currently opened in Inventor. Apprentice server is a lot quicker in opening documents, especially when dealing with a lot of files in one batch. With the solution we are building now, we move this logic out-of-process so we can still keep a similar performance.

 

Thank you for your help and I'll mark your response as the answer.

0 Likes