Cancel
Showing results for 
Search instead for 
Did you mean: 

"Library is missing required entry point" when using [OnDeserializing]

Experimenter
Experimenter

 

System info

OS: Windows 10 Pro Build 16299.665

NX version: NX 12.0.1.7 MP2, 19May18.

 

Description

It happens each time I try to load a dll with a class marked with the [Serializable] attribute and a method marked with [OnDeserializing]. If I remove the [Serializable] or the [OnDeserializing] it manages to load. The [OnSerializing] attribut does not cause this error.

 

How to reproduce it

1.- Compile the code below into a dll.

2.- Load it into NX with Execute User Function (Ctrl + U)

 

Expected result

NX shows the Information window with the message "Test"

 

Actual result

NX shows the next Error dialog

Capture.PNG

 

Code

using System;
using NXOpen;

namespace Tests
{
    class Program
    {
        public static void Main(String[] args)
        {
            Guide.InfoWriteLine("Test");
        }

        public int GetUnloadOption(string dummy)
        {
            return (int) Session.LibraryUnloadOption.Explicitly;
        }
    }

    [Serializable]
    class Foo
    {
        [System.Runtime.Serialization.OnDeserializing]
        internal void bar()
        {

        }
    }
}

 

 

1 REPLY 1

Betreff: "Library is missing required entry point" when using [OnDeserializing]

Legend
Legend
        [System.Runtime.Serialization.OnDeserializing]
        internal void bar(StreamingContext context)
        {
            
        }

Add the above Argument to your bar.

 

Regards,

Jan

Jan Böttcher