Library missing main entry point error in nx open C#

64 Views Asked by At

I am facing this issue in NX OPEN

Library is missing required entry point

Function Name: Main

I tried creating class library with framework .NET 8.0, 7.0 & 6.0.

In all frameworks, I am facing the same issue. How to fix this?

Here are screenshots of the error and script:

enter image description here

enter image description here

1

There are 1 best solutions below

0
On

It seems that you tried to use the .NET 6.0, .NET 7.0 or.NET 8.0.

Siemens NX and NXOpen does only support .NET Framework. You need to create a ".NET Framework" class library in order to make it work. In my case, I used .NET Framework 4.7.2:

using NXOpen;

namespace NxOpenDemo
{
    public class Class1
    {
        public static void Main(string[] args)
        {
            Session theSession = Session.GetSession();

            theSession.ListingWindow.Open();
            theSession.ListingWindow.WriteFullline("Hello World!");
        }
    }
}