Message 1 of 10
dll loaded success, but Initialize doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use the netload command to load my dll, but the code in MyApp.Initialize() doesn't execute and my command doesn't work. This problem does not appear on the cad2012 version, but sometimes it occurs in the cad2016,2018,2020 version.
If I build new project, this problem does not appear.
So what's wrong with my project?
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
[assembly: ExtensionApplication(typeof(MyNamespace.MyApp))]
namespace MyNamespace{
public class MyApp : IExtensionApplication
{
public void Initialize()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
ed.WriteMessage("MyDll load success");
}
//...other code
}
}

