ArcObjects Samples - No new objects added when adding the .tlb file

2451
2
08-04-2011 02:17 PM
JacobCoble
New Contributor
I have been working with some of the .NET Samples and ArcScripts. I am not able to run some .NET projects in ArcMap or ArcCatalog.

Suppose I am working on a .NET sample called "MyNewProject" and to run the tool in ArcMap, I try to import the "MyNewProject.tlb" file. I get a message box saying "No new objects added" and the .NET project does not run in ArcMap. When I try to add "MyNewProject.dll" I get the message "Can't load type library from specified file" and I cannot run the tool as a .dll in ArcMap either. For some projects, I add the .tlb or the .dll file and everything works fine, for other projects, I get the problems mentioned above.

Does anyone know what could be wrong?
0 Kudos
2 Replies
RichardWatson
Frequent Contributor
My guess is that you didn't properly expose the required information to COM.  There are many steps to doing this correctly and I am pretty sure that many of the samples do this.

If you want to understand the difference between a project which works and one which does not then use Ole2View to view and compare the contents of the type libraries (tlb).
0 Kudos
NeilClemmons
Regular Contributor III
Also, to add to what Richard said, if you're trying to run your dll inside ArcGIS on the same machine you're developing on then you shouldn't have to add from file.  The act of compiling the dll inside Visual Studio should perform all of the necessary registration (if you've set everything up correctly) so that when you open ArcMap your tools should already be there.
0 Kudos