Desktop Console Applicaiton does not close window in 10.1

Discussion created by jsn on Jun 11, 2013
Latest reply on Jul 12, 2013 by jsn
Hi all

I wrote a Desktop Console Application in 9.3 and it works fine.  Then I upgraded to  10.0 and it works fine too.

I copied the application  to a Windows server 2008R2 with ArcGIS 10.1 recompiled, etc, and now I have a problem when I run the .exe alone, the Console Window does not close, it stays open.

I am using VS 2010 VB.NEt and if I run the application from VS 2010 IDE it works fine, but running it as a stand alone program the Console Window does not close.

I am checking the code and commenting the following line:

      pFeatureClass = gputilities.OpenFeatureClassFromString(pathOutput) 

the stand alone program works fine.

Anyone with a similar problem

  'ESRI License Initializer generated code.
        If (Not m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeAdvanced}, _
        New esriLicenseExtensionCode() {})) Then
            Console.WriteLine("This application could not initialize with the correct ArcGIS license and will shutdown.")
        End If

        ' Initialize the Geoprocessor
        GP = New ESRI.ArcGIS.Geoprocessing.GeoProcessor()

        gputilities = New GPUtilitiesClass()

        ' Read App settings
        prefixOutput = System.Configuration.ConfigurationManager.AppSettings.Item("prefixOutput")
        prefixOutputOwner = System.Configuration.ConfigurationManager.AppSettings.Item("prefixOutputOwner")
        outputFC = System.Configuration.ConfigurationManager.AppSettings.Item("outputFC")
        ' FFeature class 
        pathOutput = prefixOutput & prefixOutputOwner & outputFC

        ' create points


            '   pathOutput = SDE Feature Class where the program creates points 
            pFeatureClass = gputilities.OpenFeatureClassFromString(pathOutput)

            Console.WriteLine("Create Points")

            ' CreatePoints()

            pFeatureClass = Nothing

        Catch ex As Exception

        End Try