<?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 Re: The Product License has not been initialised in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/1046347#M20306</link>
    <description>&lt;P&gt;Hello. We have tasks on Task scheduler that run Python 3 scripts. I have scripts that had been running fine for weeks just recently not run at all with this&lt;/P&gt;&lt;P&gt;RuntimeError: The Product License has not been initialized.&lt;/P&gt;&lt;P&gt;I saw your reply, logged into ArcGIS Pro and it is now working. So I guess we have to log in periodically for our scheduled tasks to run? Kind of defeats the purpose of automation.&amp;nbsp; At least they are running again and I'm glad I saw your reply.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Apr 2021 14:20:11 GMT</pubDate>
    <dc:creator>ShariForbes</dc:creator>
    <dc:date>2021-04-13T14:20:11Z</dc:date>
    <item>
      <title>The Product License has not been initialised</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/453147#M12303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;From last two days i am stuck in this error.i have googled it.but could not succeed.i am trying to connect arcsde geodatabase using arcobjects.&lt;/P&gt;&lt;P&gt;license status function return true and when i try to open the workspace factory i face the error "&lt;SPAN style="font-size: 22px; color: #993300;"&gt;&lt;STRONG&gt;The Product License has not been initialised&lt;/STRONG&gt;".please help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if (&lt;SPAN&gt;LicenseStatus&lt;/SPAN&gt;())&lt;BR /&gt; {&lt;BR /&gt; Console.WriteLine("Ready with license.");&lt;BR /&gt; IPropertySet propertySet = new PropertySetClass();&lt;/P&gt;&lt;P&gt;propertySet.SetProperty("SERVER", "DESKTOP-FQEJI3R");&lt;BR /&gt; //propertySet.SetProperty("SERVERINSTANCE", "localhost");&lt;BR /&gt; propertySet.SetProperty("SERVERINSTANCE", "sde:sqlserver:DESKTOP-FQEJI3R");&lt;BR /&gt; propertySet.SetProperty("DATABASE", "Test"); // Only if it is needed&lt;BR /&gt; propertySet.SetProperty("AUTHENTICATION_MODE", "DBMS");&lt;BR /&gt; propertySet.SetProperty("USER", "*****");&lt;BR /&gt; propertySet.SetProperty("PASSWORD", "*****");&lt;BR /&gt; //propertySet.SetProperty("DBCLIENT", "SQLServer");&lt;BR /&gt; propertySet.SetProperty("VERSION", "sde.Default");&lt;BR /&gt; // Create an SDE workspace factory and open the workspace.&lt;BR /&gt; Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");&lt;BR /&gt; IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);&lt;BR /&gt; &lt;SPAN style="font-size: 22px;"&gt;&lt;STRONG style="color: #993300; "&gt;IWorkspace workspace = workspaceFactory.Open(propertySet, 0); error Line&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt; //CreateMathFunctionRasterDataset();&lt;BR /&gt; aoInit.Shutdown();&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; catch (Exception exc)&lt;BR /&gt; {&lt;BR /&gt; aoInitialize.Shutdown();&lt;BR /&gt; // If it fails at this point, shutdown the test and ignore any subsequent errors.&lt;BR /&gt; Console.WriteLine(exc.Message);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public bool LicenseStatus()&lt;BR /&gt; {&lt;BR /&gt; //This sample is designed to perform license initialization on a system&lt;BR /&gt; //that may have access to a floating license. An ArcEditor license will be used.&lt;/P&gt;&lt;P&gt;aoInitialize = new AoInitializeClass();&lt;/P&gt;&lt;P&gt;//Check the productCode.&lt;BR /&gt; esriLicenseStatus licenseStatus = aoInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);&lt;BR /&gt; if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)&lt;BR /&gt; {&lt;BR /&gt; //Initialize the license.&lt;BR /&gt; licenseStatus = aoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//Take a look at the licenseStatus to see if it failed.&lt;BR /&gt; if (licenseStatus == esriLicenseStatus.esriLicenseNotLicensed)&lt;BR /&gt; {&lt;BR /&gt; //Not licensed.&lt;BR /&gt; MessageBox.Show("You are not licensed to run this product");&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; else if (licenseStatus == esriLicenseStatus.esriLicenseUnavailable)&lt;BR /&gt; {&lt;BR /&gt; //The licenses needed are currently in use.&lt;BR /&gt; MessageBox.Show("There are insufficient licenses to run");&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; else if (licenseStatus == esriLicenseStatus.esriLicenseFailure)&lt;BR /&gt; {&lt;BR /&gt; //The licenses unexpectedly failed.&lt;BR /&gt; MessageBox.Show(&lt;BR /&gt; "Unexpected license failure please contact your administrator");&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; else if (licenseStatus == esriLicenseStatus.esriLicenseAlreadyInitialized)&lt;BR /&gt; {&lt;BR /&gt; //Already initialized (initialization can only occur once).&lt;BR /&gt; MessageBox.Show(&lt;BR /&gt; "Your license has already been initialized; please check your implementation.");&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; &lt;SPAN style="color: #ff6600; font-size: 22px;"&gt;&lt;STRONG&gt;else if (licenseStatus == esriLicenseStatus.esriLicenseCheckedOut)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600; font-size: 22px;"&gt;&lt;STRONG&gt; {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600; font-size: 22px;"&gt;&lt;STRONG&gt; //Everything was checked out successfully.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600; font-size: 22px;"&gt;&lt;STRONG&gt;MessageBox.Show("Licenses checked out successfully");&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600; font-size: 22px;"&gt;&lt;STRONG&gt; return true;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600; font-size: 22px;"&gt;&lt;STRONG&gt; }&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;return false;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:04:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/453147#M12303</guid>
      <dc:creator>NadirHussain</dc:creator>
      <dc:date>2019-08-20T16:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: The Product License has not been initialised</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/453148#M12304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was running my script without signing into arcgis pro/online.&amp;nbsp;the error went away after i signed in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 18:18:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/453148#M12304</guid>
      <dc:creator>aronlangley</dc:creator>
      <dc:date>2020-07-20T18:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: The Product License has not been initialised</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/1046347#M20306</link>
      <description>&lt;P&gt;Hello. We have tasks on Task scheduler that run Python 3 scripts. I have scripts that had been running fine for weeks just recently not run at all with this&lt;/P&gt;&lt;P&gt;RuntimeError: The Product License has not been initialized.&lt;/P&gt;&lt;P&gt;I saw your reply, logged into ArcGIS Pro and it is now working. So I guess we have to log in periodically for our scheduled tasks to run? Kind of defeats the purpose of automation.&amp;nbsp; At least they are running again and I'm glad I saw your reply.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 14:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/the-product-license-has-not-been-initialised/m-p/1046347#M20306</guid>
      <dc:creator>ShariForbes</dc:creator>
      <dc:date>2021-04-13T14:20:11Z</dc:date>
    </item>
  </channel>
</rss>

