Hi everyone i am new to C#. And i am trying to load my first .net "hello world" code. I am able to successfully create a .dll file (without any errors). But the problems come when i try to Netload the dll. When i Netload my dll it does not do anything. When i type command AutoCAD tells me that no such command is found. Please help.
Thank you,
-Jay
Can you post the section of code where your command starts?
Make sure you have Copy Local set to False for AcDbMgd.dll and AcMgd.dll which you referenced.
This is just the first of many annoying things you will have to remember.
Also, if you're running a newer version of visual studio, you will have to change the framework to 3.5
In project properties (for each project in your solution) you need to change "Target Framework" to .NET Framework 3.5
Just to be clear, the problem you have is not that NETLOAD does
not want to load your DLL.
There are quite a few possible reasons that can cause
AutoCAD to not recognize CommandMethods:
- CopyLocal on AutoCAD assemblies are not set to False.
- The CommandClass attribute is being used in the same
assembly, but is not used to identify the class that has
CommandMethod(s) that are not recognized.
- The class exposing the CommandMethod does not have
'publc' visiblity.
- The method with the CommandMethod attribute on it does
not have 'public' visibility. If you are just starting out, the
method should also be declared as 'static' (Shared in VB).
- Multiple CommandMethods with the same name.
- If your assembly includes a class that implements
IExtensionApplication, and an exception is being thrown
by the code in (or called from) that interface's Initialize()
method, no commands are defined.
There are other causes, but these are the most
common ones.
First, thank you everyone for your help. This was a very broad question. . . I apologies for that I should know better.
Additional thanks to you Mohnston, I was very near of destroying my machine.Your suggestion did the trick. Thanks
-J