<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ArcGIS license corrupted by standalone application in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcgis-license-corrupted-by-standalone-application/m-p/592113#M15953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a problem my coworkers and I have encountered several times without being able to track down the exact issue, and a very annoying and almost untestable one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When testing a standalone application using ArcObjects, at the some point the license would end up corrupted and impossible to repair without contacting ESRI support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A sample of the latest application in development that corrupted my license recently:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; 
[STAThread]
static void Main(string[] args)
{
&amp;nbsp; AoInitialize arcObjectInitialize = null;

 
 if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop))
 {
&amp;nbsp; System.Console.WriteLine("This application could not load the correct version of ArcGIS.");
&amp;nbsp; Environment.Exit(Environment.ExitCode);
 }
&amp;nbsp; 
 try
 {
&amp;nbsp; arcObjectInitialize = new AoInitialize();
&amp;nbsp; esriLicenseProductCode typeLicense;

&amp;nbsp; if (arcObjectInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeBasic) == esriLicenseStatus.esriLicenseAvailable)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; typeLicense = esriLicenseProductCode.esriLicenseProductCodeBasic;
&amp;nbsp;&amp;nbsp; arcObjectInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeBasic);
&amp;nbsp; }
&amp;nbsp; else
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (arcObjectInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeStandard) == esriLicenseStatus.esriLicenseAvailable)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; typeLicense = esriLicenseProductCode.esriLicenseProductCodeStandard;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcObjectInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (arcObjectInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeAdvanced) == esriLicenseStatus.esriLicenseAvailable)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeLicense = esriLicenseProductCode.esriLicenseProductCodeAdvanced;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcObjectInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new Exception("ArcView");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
 catch
 {
&amp;nbsp; Console.WriteLine("No valid license found, exiting program.");
&amp;nbsp; Environment.Exit(Environment.ExitCode);
 }
 
 
 //Some processings...
 
 
 try
 {
&amp;nbsp; arcObjectInitialize.Shutdown();
 }
 catch
 {
&amp;nbsp; Console.WriteLine("License shutdown failed, exiting program.");
&amp;nbsp; Environment.Exit(Environment.ExitCode);
 }
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It follows the examples given on the support, but if there is something more to check or something that shouldn't be done, I woul be really glad to know what. The latest corruption happened while ArcMap was running in background, should it be avoided ? Is it a known issue or is there a way to check if the license is in use ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2013 14:46:17 GMT</pubDate>
    <dc:creator>ArnaudFradin</dc:creator>
    <dc:date>2013-08-01T14:46:17Z</dc:date>
    <item>
      <title>ArcGIS license corrupted by standalone application</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcgis-license-corrupted-by-standalone-application/m-p/592113#M15953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a problem my coworkers and I have encountered several times without being able to track down the exact issue, and a very annoying and almost untestable one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When testing a standalone application using ArcObjects, at the some point the license would end up corrupted and impossible to repair without contacting ESRI support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A sample of the latest application in development that corrupted my license recently:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; 
[STAThread]
static void Main(string[] args)
{
&amp;nbsp; AoInitialize arcObjectInitialize = null;

 
 if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop))
 {
&amp;nbsp; System.Console.WriteLine("This application could not load the correct version of ArcGIS.");
&amp;nbsp; Environment.Exit(Environment.ExitCode);
 }
&amp;nbsp; 
 try
 {
&amp;nbsp; arcObjectInitialize = new AoInitialize();
&amp;nbsp; esriLicenseProductCode typeLicense;

&amp;nbsp; if (arcObjectInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeBasic) == esriLicenseStatus.esriLicenseAvailable)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; typeLicense = esriLicenseProductCode.esriLicenseProductCodeBasic;
&amp;nbsp;&amp;nbsp; arcObjectInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeBasic);
&amp;nbsp; }
&amp;nbsp; else
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (arcObjectInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeStandard) == esriLicenseStatus.esriLicenseAvailable)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; typeLicense = esriLicenseProductCode.esriLicenseProductCodeStandard;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcObjectInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (arcObjectInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeAdvanced) == esriLicenseStatus.esriLicenseAvailable)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeLicense = esriLicenseProductCode.esriLicenseProductCodeAdvanced;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcObjectInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new Exception("ArcView");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
 catch
 {
&amp;nbsp; Console.WriteLine("No valid license found, exiting program.");
&amp;nbsp; Environment.Exit(Environment.ExitCode);
 }
 
 
 //Some processings...
 
 
 try
 {
&amp;nbsp; arcObjectInitialize.Shutdown();
 }
 catch
 {
&amp;nbsp; Console.WriteLine("License shutdown failed, exiting program.");
&amp;nbsp; Environment.Exit(Environment.ExitCode);
 }
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It follows the examples given on the support, but if there is something more to check or something that shouldn't be done, I woul be really glad to know what. The latest corruption happened while ArcMap was running in background, should it be avoided ? Is it a known issue or is there a way to check if the license is in use ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 14:46:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcgis-license-corrupted-by-standalone-application/m-p/592113#M15953</guid>
      <dc:creator>ArnaudFradin</dc:creator>
      <dc:date>2013-08-01T14:46:17Z</dc:date>
    </item>
  </channel>
</rss>

