[C# MicroStation V8i SELECTSeries 10] OpenDesignFile causes error 'No design file is active'

I have this code below working in an MS_INITAPP for MicroStation CONNECT edition update 15, but running it in MicroStation V8i in an entirely new project for.NET 3.5, I am seeing the following error: 

No design file is active
at Bentley.Interop.MicroStationDGN.Application.OpenDesignFile(String DesignFileName, Boolean ReadOnly, MsdV7Action V7Action)

Source code:

private Bentley.Interop.MicroStationDGN.Application app;


protected override int Run(string[] commandLine)
{
    app = Bentley.MicroStation.InteropServices.Utilities.ComApp;
    app.Visible = false;

...
...

    DesignFile designFile = app.OpenDesignFile(document.Path, true, MsdV7Action.UpgradeToV8);

...
}

The C# .NET35 project for the MicroStation V8i project has all the dll references to the V8i versions as seen below which differs from the CONNECT Edition:

Bentley.Genral.1.0

bentley.interop.microstationdgn

bentley.microstation

Bentley.MicroStation.General

bentley.microstation.interfaces.1.0

ustation

Parents
  • First, some basics...

    1. MicroStation V8 is a 32-bit app.  Are you building your Viz Studio DLL for a 32-bit processor?
    2. Which version of Viz Studio are you using?
    3. Is document.Path a valid file?
    4. You're attempting to open the file read-only: is that what you want?
    I am seeing the following error

    When do you see that error?  If you attach the Viz Studio debugger to the MicroStation executable, step through until you see an exception.  Perhaps the Viz Studio tracer can reveal the problem.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • First, some basics...

    1. MicroStation V8 is a 32-bit app.  Are you building your Viz Studio DLL for a 32-bit processor?
    2. Which version of Viz Studio are you using?
    3. Is document.Path a valid file?
    4. You're attempting to open the file read-only: is that what you want?
    I am seeing the following error

    When do you see that error?  If you attach the Viz Studio debugger to the MicroStation executable, step through until you see an exception.  Perhaps the Viz Studio tracer can reveal the problem.

     
    Regards, Jon Summers
    LA Solutions

Children