Bin schon paar mal selbst drüber gestolpert, darum hier eine Notiz an mich selbst:
Will man eine EPLAN Offline Anwendung als Konsolenapplikation erstellen muss die Main() Methode mit dem Compiler Attribut [STAThread] ausgestattet werden:
using System;
using System.IO;
using System.Linq;
using Suplanus.Sepla.Application;
namespace ibKastl.Meco.Test.Console
{
class Program
{
[STAThread]
static void Main(string[] args)
{
// Start EPLAN
System.Console.WriteLine("Starting EPLAN...");
string binPath = Starter.GetEplanInstallations()
.Last(obj => obj.EplanVariant
.Equals("Electric P8"))
.EplanPath;
binPath = Path.GetDirectoryName(binPath);
EplanOffline eplanOffline = new EplanOffline(binPath, "API");
eplanOffline.StartWithoutGui();
// Close
eplanOffline.Close();
System.Console.ReadKey();
}
}
}
Hab das auch noch in den Kommentar der Starter gepackt:

Hinterlasse einen Kommentar