AutoCAD's official way to load .dll files written in .Net on startup is to use autoloader feature.
You basically bundle the .dll with any other files you want into a default folder where AutoCAD reads at startup to load all plug-ins. This is especially good if you want to distribute your plug-in (.dll) as a setup file to install on multiple machines.
First step is to create a bundle folder in "%ProgramData%/Autodesk/ApplicationPlugins
". the bundle folder is a normal windows folder that ends with .bundle (ex. MyApp.bundle)
Inside this folder you need to have a folder named ("Contents") and a file named ("PackageContents.xml
").
Place .dll inside the contents folder
code inside PackageContents.xml
can be as simple as the following (Change things like "MyApp
", "MyName
", etc.. and it should work for you):
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" ProductType="Application" Name="MyAPP" AppVersion="1.0" Description="MyAPP, My description" Author="My Name" Icon="./Contents/MyAPPIcon.ico" OnlineDocumentation="http://MyWebSite.com" HelpFile="" ProductCode="{xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx}" FriendlyVersion="1.0" SupportedLocales="Enu" AutodeskProduct="AutoCAD">
<CompanyDetails Name="My Name" Phone=" " Url="http://MyWebsite.com" Email="MyName@MyWebSite.com" />
<Components Description="Main">
<RuntimeRequirements SupportPath="./Contents" OS="Win32|Win64" Platform="AutoCAD*" SeriesMin="R19.0" SeriesMax="R22.0" />
<ComponentEntry AppName="MyAPP" Version="1.0" ModuleName="./Contents/MyAPP.dll" AppDescription="My description" LoadOnAppearance="True" LoadOnAutoCADStartup="True" LoadOnCommandInvocation="True">
</ComponentEntry>
</Components>
</ApplicationPackage>
I think the above is enough to answer your question but if you need more read the article in the following link:
http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html