MicroStation Programming Forum - Can't open MicroStation instance through VB.NET App
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Can't open MicroStation instance through VB.NET App

by
Rob Golding
Contributor

Hi Everyone, 

I am trying to create a stand alone VB.NET EXE application that simply opens up MicroStation, pulls some tag information and closes. I have created these types of applications before but not for quite a while so i must be a bit rusty.

I am having issues with the error messages stating "RPC Server Unavailable" and similar. I can also see that once the new Instance is called that nothing is showing in task Manager. So my question is what am i doing wrong for MicroStation not to open?

I have looked at previous projects and the below used to work, but for troubleshooting I have created a new, very bare application just to test this functionality to remove any other potential issues but still having the same problem. I have referenced the MicroStationDGN library in Visual Studio and imported the namespace. The entire code is below. At this stage i'm just trying to get MicroStation to open, then i will add the tag functionality into it once i know im on the right track. I can open MicroStation with no issues from the Start Menu so it is working normally.

The version of MicroStation on this test machine is V8i SS3 (08.11.09.292) - Yes i know its old, but its just the test machine.


Imports MicroStationDGN

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim ustn As New MicroStationDGN.Application

        Dim odesignfile As MicroStationDGN.DesignFile

        Try
            odesignfile = ustn.OpenDesignFile("C:\Temp\rob.dgn")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub
End Class