Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
2  
"Does not work" does not explain much. Can you elaborate? Does the application crash, does it produce an error message, etc.? – blah238 Jan 21 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... – Joel Apr 8 at 18:41

1 Answer

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
    {
        [STAThread]
        private static void Main(string[] args)
        {
            RuntimeManager.BindLicense(ProductCode.EngineOrDesktop);
            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>
share|improve this answer
Thanks a lot - I used option 2 and that worked – Fskov Jan 22 at 20:25
Great! Please accept the answer if it worked for you. – blah238 Jan 22 at 20:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.