POST
|
I am building an add-in for a while. It is open source and the code is here: https://mcda4arcmap.codeplex.com/SourceControl/latest. The problem: ArcMap (latest version) crashes on start up when the add-in is installed. According to the log file sometimes when the extensions are initialized, which makes sense. The interesting part is that it works very well when I start it via Visual Studio 2012. At some point in time (2 months ago?) it also worked without Visual Studio 2012, but I developed and never tested it without and therefore I have no idea what change causes this behavior. Another interesting observation is that I can install the add-in for the first time and use a small part of the functionality (every other will crash ArcMap) without a problem. When I restart ArcMap, ArcMap will crash again. The last observation is that I can start it from Visual Studio 2013. In lets say 1 out of 10 times Visual Studio 2013 will crash and ArcMap starts or ArcMap.exe cannot be started and Visual Studio 2013 does not crash. I have two external dlls included and target version is 4.5 (4.0 will also crash, I tried it). The only option I see is to remove features and try until I find the evil method call or whatever. Do I have a chace to debug the ArcMap extension initialization? It would be beneficial to know what ArcMap does with add-ins on start up, e.g. is the startup method of my extension called? What checks are performed?
... View more
05-12-2014
12:57 AM
|
0
|
1
|
1377
|
POST
|
I had similar problem. But I found solution of that problem. The reason of that problem was '&' symbol. Inside of Visual Studio project folder path was a '&' symbol (Example: D:\D&S\Aysberq\My Documents\Visual Studio 2010\Projects). I changed visual studio default project path. After that the problem solved. I have the same problem. However, I have no <&> symbol in my path and it still does not work.
... View more
11-08-2012
04:19 PM
|
0
|
0
|
424
|
POST
|
It is time consuming to restart ArMap every time I want to test my Add In. Is there an easy way to build and deploy it without a restart ArcMap?
... View more
10-10-2012
06:35 PM
|
0
|
1
|
436
|
POST
|
At the moment I am building an add in in C#. My goal is to use the data of an existing feature layer and to perform some calculations with this data. That works fine... Now I want to visualize the new values with a feature renderer like the UniqueValueRenderer. To achieve this I want to create an in-memory layer, which is a merge of the existing layer and my new data. I already found the InMemoryWorkspace but the doc says I can not create feature datasets within. Is there a way to do this on the fly or do I have to copy the old one add my column(s), add it to the TOC and later on use one of therenderer?
... View more
09-25-2012
07:07 PM
|
0
|
1
|
494
|
POST
|
In my Add-in, I used the following code. I've serialized a dictionary in the OnSave sub Protected Overrides Sub OnLoad(ByVal inStrm As System.IO.Stream) 'MyBase.OnLoad(inStrm) Dim binaryFormatter = New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter() Try theDict = CType(binaryFormatter.Deserialize(inStrm), Dictionary(Of Object, Object)) If theDict.Count > 0 Then CreateRenderer() Catch ex As Exception System.Windows.Forms.MessageBox.Show(ex.ToString, "Extension: OnLoad") End Try End Sub I think that is what I did. However I have learned two things... The first is that it is required (at least for me) to define my own SerializationBinder: sealed class MCDADeserializationBinder : SerializationBinder { public override Type BindToType(string assemblyName, string typeName) { return Type.GetType(typeName + "," + Assembly.GetExecutingAssembly().FullName); } } Moreover it seems that is possible to serialize self created objects, but it is not possible to serialize them in a List or something generic. That is also true if you implement the suggested interfaces form ESRI or Microsoft. So I have to do some workarounds by saving only plain strings in List. That works for me: protected override void OnSave(Stream outStrm) { var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); //persist onlz the unique layer names of selected layer _listOfSelectedUniqueLayerNamesForPersistence = _listOfAvailableLayer.Where(l => l.isSelected).Select(l => l.UniqueLayerName).ToList(); bf.Serialize(outStrm, _listOfSelectedUniqueLayerNamesForPersistence); } protected override void OnLoad(Stream inStrm) { var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); //bf.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple; bf.Binder = new MCDADeserializationBinder(); _listOfSelectedUniqueLayerNamesForPersistence = null; _listOfSelectedUniqueLayerNamesForPersistence = bf.Deserialize(inStrm) as List<string>; }
... View more
08-22-2012
05:09 PM
|
0
|
0
|
311
|
POST
|
Hi, I followed the LogExtension example http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Sample_Persisting_data_by_implementing_an_extension_using_add_ins/0001000004m1000000/ and I have the some problem with the binaryFormatter and the SerializationHelper protected override void OnSave(Stream outStrm) { base.OnSave(outStrm); //PersistenceHelper.Save<SerializableObserveableCollection<ESRI.ArcGIS.Carto.ILayer>>(outStrm, availableLayer); var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); //bf.Serialize(outStrm, availableLayer); PersistenceHelper.Save<ObservableCollection<Layer>>(outStrm, availableLayer); } protected override void OnLoad(Stream inStrm) { base.OnLoad(inStrm); //SerializableObserveableCollection<ESRI.ArcGIS.Carto.ILayer> o = new SerializableObserveableCollection<ESRI.ArcGIS.Carto.ILayer>(); var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); availableLayer = new ObservableCollection<Layer>(); //availableLayer = (ObservableCollection <Layer>) bf.Deserialize(inStrm); PersistenceHelper.Load<ObservableCollection<Layer>>(inStrm, ref availableLayer); } The OnSave methods seems to work fine, but the Load call returns with: Unable to find assembly 'MCDA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. According to "the internet" this is usually the case if two different applications(assemblies) try to work on the same data, which is not the case. I have no idea how to solve this...
... View more
08-21-2012
10:07 AM
|
0
|
2
|
683
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|