Autodesk.Inventor.Interop.dll on WinServer 64-bit 2012 R2 - interface non registred

1

i'm trying to develop a very simple web application based on the Autodesk Inventor engine.

I'm developing on Win7 64-bit with Visual Studio 2010 and Inventor 2015 and everything it's working perfectly on debugging but when i publish on the web server i get the error:

HRESULT: 0x800401F3 (CO_E_CLASSSTRING)

and the message

interface string not valid

The C# code line where i receive the error is:

Inventor.Application _invApp = (Inventor.Application)Marshal.GetActiveObject("Inventor.Application");

The full code for my test is the following:

using Inventor;
using System.Runtime.InteropServices;
namespace web_debug_cs
{
    public partial class debug_runinventor : Ssytem.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e) { startInventorApplication(); }
        private void startInventorApplication()
        {
            string sDebug = string.Empty;
            try
            {
                Inventor.Application _invetorApp = (Inventor.Application)Marshal.GetActiveObject("Inventor.Application");
                sDebug = "Success!!!";
            }
            catch (Exception ex) { sDebug = "UNSUCCESS!<br />" + ex.Message; }
            lblAnswer.Text = sDebug;
        }
    }
}

I get this code directly from the Inventor 2015 guide, but (repeat) on the local machine everything it's ok, but not on the server.

  • I checked the permission (everyone: full control)
  • I registred manually with regsvr32 (impossible to register) both on system32 and SysWOW64
  • I registred on the framework 32 and 64 with regasm (registration success!)
  • I set the web site to work with 32-bit application

but nothing could solve this issue.

I thought about the possibility to import manually the dll with pInvoke, but with no success...

I googled a lot, i tryed to ask to Autodesk with no success.

I started Inventor on the Server to verify if it works, and it work perfectly!

Could anyone try to help me?

Thanks in advance for any kind reply!

Emanuele

c#
asp.net
dll
autodesk
interopservices

1 Answer

0

I would not expect this to work due a simple reason: the webpage is running as a service, and Inventor runs as a user-level application. Imagine the following: the web page is requested by 100 clients/browsers, your app will launch Inventor 100 times. But more than that, the webpage is not on the user-level.

The best chance to work would be: your webpage receives a request (let's say create a .ipt file), create a record that the action must be performed (for instance, a new .txt file with instructions or a database entry), a Windows services detects the request and launch Inventor to process it. In this case you'll have a queue where requests are placed by your webpage, but processed later.

But I must say this is not supported nor allowed on the EULA, please review it.

answered on Stack Overflow Jul 2, 2015 by Augusto Goncalves

User contributions licensed under CC BY-SA 3.0