Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CONNECT C#] Load(String[] commandTail, IntPtr mdlDesc) NullReferenceException

$
0
0

Microstation Connect Edition update 6

Windows 7 SP1

Visual Studion 2015

target framework: 4.6.1

Hello Everyone,

I have developed testing C# AddIn but met a problem loading it. I have been searching through this forum and the Internet but did not find relevant information.

after keyin

MDL LOAD TESTCSADDIN,,TESTCSADDIN

I receive next .NET error message.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Bentley.MstnPlatformNET.AddIn.Load(String[] commandTail, IntPtr mdlDesc)

keyin

MDL LOAD TESTCSADDIN

works

What I did wrong?

source code:

using System.Windows.Forms;
using Bentley.MstnPlatformNET;

namespace TestCsAddIn
{
    [AddInAttribute(MdlTaskID = "TestCsAddIn")]
    internal sealed class TestCsAddIn : AddIn
    {
        private TestCsAddIn(System.IntPtr mdlDescriptor) : base(mdlDescriptor)
        {
        }

        protected override int Run(string[] commandLine)
        {
            MessageBox.Show("Test message");

            return 0;
        }
    }
}

Regards,

Alex


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>