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

  • Thanks @Augusto for your reply, it's clear your opinion and i think your're right, my second doubt was regarding this question and you anticipate me. But my first doubt is why on developing on the local machine it works perfectly? Probably because my machine can resolve the call without using IIS service? My application should run in an local Intranet, not on a public WebServer. – Emanuele Boccaletti Jul 03 '15 at 12:22
  • most likely when you run on debug your Windows account is allowing it, somehow (sorry I'm not an expert on Win Server permissions) – Augusto Goncalves Jul 03 '15 at 12:45
  • Thanks for your reply and the confirmation. I agree with you about the differences between my windows account in deployment and the Web Account on the Server. – Emanuele Boccaletti Jul 03 '15 at 15:20

1 Answers1

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.

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44