Skip to main content
8-Gravel
February 17, 2026
Solved

Creo VB API cannot connect when I switch network.

  • February 17, 2026
  • 1 reply
  • 214 views
I am using Creo Parametric Release 8.0 and Datecode 8.0.12.0

I have some Creo VB API program. All work fine if you stay on same network all the time. If I start Creo with LAN (eternet) connection and take my laptop to a conference room with WiFi. Then I cannot connect with Creo API.

Here are the errors that I faced
pfcExceptions::XToolkitNotFound

Code:
Public Shared Function ACon(sender As System.Object)
'Connect to Creo... first with last saved connection data...
Dim cs As String = $"c:\ptc\Creo8\connection_string.ini"
Try
If File.Exists(cs) Then connection_id = File.ReadAllLines(cs).FirstOrDefault()?.Trim()
local_connId = ConId.Create(connection_id)
asyncConnection = ccon.ConnectById(local_connId, ".", 30)
Catch ex As Exception
If asyncConnection IsNot Nothing AndAlso asyncConnection.IsRunning Then
asyncConnection.Disconnect(1)
End If
End Try
'If it did not work above, try to connect with std connection string, if failed kill pfclscom and it might work next loop..
If asyncConnection Is Nothing Then
System.Threading.Thread.Sleep(500)
Try
If asyncConnection Is Nothing OrElse Not asyncConnection.IsRunning Then
asyncConnection = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, 5)
End If
Catch ex2 As Exception
For Each p In Process.GetProcessesByName("pfclscom")
Try : p.Kill() : Catch : End Try
Next
End Try
End If
'Last chance....
If asyncConnection Is Nothing Then
System.Threading.Thread.Sleep(500)
Try
If asyncConnection Is Nothing OrElse Not asyncConnection.IsRunning Then
asyncConnection = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, 5)
End If
Catch ex2 As Exception
Return asyncConnection
Exit Function
End Try
End If
Try
File.WriteAllText(cs, asyncConnection.GetConnectionId.ExternalRep & Environment.NewLine)
Catch
End Try
Return asyncConnection
End Function
    Best answer by remy

    Thank you for your confirmation.
    After searching the knowledge base, I have found this article : https://www.ptc.com/en/support/article/CS287881

    It says that The IP of the network driver is part of the session signature when the asynchronous application is started. 

    The article is about the Java Object Toolkit flavor but the cause remains.

    Consequently the solution consists in :
    1. detecting the change of ip ie the disconnection (which your code already does)
    2. reconnect

     

    1 reply

    21-Topaz I
    February 17, 2026

    Hi 

    VB API and Toolkit at large leverage existing functionality.
    Can you confirm that switching network keeps the session stable wimply with Creo Parametric ?

    what's the behavior when you have, let's say a model in session, then change network ?

    LBilén8-GravelAuthor
    8-Gravel
    February 18, 2026

    When I change networks, everything works fine in Creo. I can check in and out. The license is OK. Downloading .prt and .asm works. It's just the VB API that has crashed.

    remy21-Topaz IAnswer
    21-Topaz I
    February 18, 2026

    Thank you for your confirmation.
    After searching the knowledge base, I have found this article : https://www.ptc.com/en/support/article/CS287881

    It says that The IP of the network driver is part of the session signature when the asynchronous application is started. 

    The article is about the Java Object Toolkit flavor but the cause remains.

    Consequently the solution consists in :
    1. detecting the change of ip ie the disconnection (which your code already does)
    2. reconnect