# ArcGIS 10.1 using Repast's Agent Analyst Extension - refresh.exe does not work

I have installed the agent analyst extension for ArcGis. The refresh.exe, however, does not work. I have made a direct reference to the folder where refresh.exe is.

-
"Does not work" does not explain much. Can you elaborate? Does the application crash, does it produce an error message, etc.? –  blah238 Jan 21 '13 at 22:14
For the 2nd option, do you post it right in the Refresh folder? I did that and still couldn't get it to go. My directory is C:\Repast 3\Agent Analyst\Refresh and then I pasted in the config file. Thanks... –  user16956 Apr 8 '13 at 18:41
The option 2 does not work for me, I copied it and pasted it on the notepad and saved as to Refresh.exe.config and then I pasted it on C:Repast3\AgentAnalysis\refresh THen I tried to open Agent Based Analysis in the ArcToolbox but it did not work. Do I need to do something else in order to get this program run on ArcGIS10.1? –  user18825 Jun 4 '13 at 19:43
@user18825, have a look at this question: gis.stackexchange.com/q/57563/753 –  blah238 Jun 4 '13 at 20:58

Try building the following C# program with Visual Studio; this should be a drop-in replacement. I am not sure what is wrong with the included refresh.exe but it crashes with a generic APPCRASH on my 10.1 installation:

using System;
using ESRI.ArcGIS;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Framework;

namespace Refresh
{
internal class Program
{
private static void Main(string[] args)
{
IAppROT appROT = new AppROTClass();
if (appROT.Count > 0)
{
for (int i = 0; i < appROT.Count; i++)
{
if (appROT.Item[i] is IMxApplication)
{
IMxDocument mxDocument = (IMxDocument)appROT.Item[i].Document;
mxDocument.ActiveView.Refresh();
}
}
}
}
}
}


Update: The issue seems to be that at ArcGIS 10.0+, ESRI no longer provides policy files allowing for assembly redirection (so you have to re-compile for each new version). See this ESRI forum thread for more info. A possible alternative solution to recompiling the program would be to create a publisher policy file that redirects the 10.0 assemblies to the 10.1 assemblies.

Update 2: Instead of recompiling, you can create an application configuration file to redirect the 10.0 assembly dependencies to the 10.1 assemblies. Copy/paste the following into a text editor and save it as Refresh.exe.config alongside Refresh.exe. Worked for me anyways:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ESRI.ArcGIS.ArcMapUI" publicKeyToken="8fc3cc631e44ad86" />
<bindingRedirect oldVersion="10.0.0.0" newVersion="10.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ESRI.ArcGIS.Carto" publicKeyToken="8fc3cc631e44ad86" />
<bindingRedirect oldVersion="10.0.0.0" newVersion="10.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ESRI.ArcGIS.Framework" publicKeyToken="8fc3cc631e44ad86" />
<bindingRedirect oldVersion="10.0.0.0" newVersion="10.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ESRI.ArcGIS.System" publicKeyToken="8fc3cc631e44ad86" />
<bindingRedirect oldVersion="10.0.0.0" newVersion="10.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ESRI.ArcGIS.Version" publicKeyToken="8fc3cc631e44ad86" />
<bindingRedirect oldVersion="10.0.0.0" newVersion="10.1.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

-
Thanks a lot - I used option 2 and that worked –  Fskov Jan 22 '13 at 20:25
Great! Please accept the answer if it worked for you. –  blah238 Jan 22 '13 at 20:52