custom metadata editor using c#.net
-
Hi, Has anyone developed a custom metadata editor using C#.net or vb.net. if yes, i have a question. I am trying to develop a custom metadata editor using C#.net. i am using ArcGis 8.3 and Visual studio .net 2003. when i am trying to execute my custom metadata editor in ArcCatalog it says "Object reference not set to an instance of an object". i don't know where i am going wrong.. I appreciate your help in this regard.. example is given on http://arcobjectsonline.esri.com Thanks, Abhi abhi
-
Hi, Has anyone developed a custom metadata editor using C#.net or vb.net. if yes, i have a question. I am trying to develop a custom metadata editor using C#.net. i am using ArcGis 8.3 and Visual studio .net 2003. when i am trying to execute my custom metadata editor in ArcCatalog it says "Object reference not set to an instance of an object". i don't know where i am going wrong.. I appreciate your help in this regard.. example is given on http://arcobjectsonline.esri.com Thanks, Abhi abhi
This may be useful - I got this error once for a completely different project (nothing related to yours) and it turned out that some of the dll's I had added a reference to had recently changed and I had an older copy. Say the new X.dll had a ftn call Y() and my lod X.dll did not contain the ftn Y(). Funny thing is the code compiled fine but at runtime it caused the exception you are getting. When I refreshed the dll, it worked fine. Hope this helps.
-
This may be useful - I got this error once for a completely different project (nothing related to yours) and it turned out that some of the dll's I had added a reference to had recently changed and I had an older copy. Say the new X.dll had a ftn call Y() and my lod X.dll did not contain the ftn Y(). Funny thing is the code compiled fine but at runtime it caused the exception you are getting. When I refreshed the dll, it worked fine. Hope this helps.
Actually, that would throw a
TypeLoadException
since the types are not the same, but you apparently handled the exception and continued executing code, meaning that the object you were trying to instantiate of that type was stillnull
, hence theNullReferenceException
. You can avoid this problem in your multi-project solution by adding project reference instead of assembly reference. So, if project "B" depends on project "A", right-click on project "B", select Add Reference, then click the Projects tab. Double-click project "A" to add it. Now a build dependency is established. Any changes to project "A" will cause project "A" to be compiled when you compiled project "B", and if project "A" is recompile project "B" will grab the new copy when it's compiled. This also means that when you compile a release build of project "B", a release build is compiled for project "A", thus keeping your builds in sync as well.Microsoft MVP, Visual C# My Articles