.NET ArcEngine application using Desktop license - not working

3907
13
04-08-2011 04:29 PM
AdityaTadakaluru
New Contributor
did you resolve this issue ? Im facing the similar issue when I install my ArcGIS engine 10 .NET app on a machine with ArcGIS Desktop10 and No ArcGIS Engine runtime.

Im doing

ESRI.RuntimeManager.BindLicense(ProductCode.EngineOrDesktop)

and when I check the RuntimeManager.ActiveRuntime its showing "Desktop" , but when the execution reaches endinit function of AXMapControl in my form.designer.cs , Im getting  You must have a license to use this ActiveX Control. Prior to AxMapControl.EndInit() I have AxToc and AxToolbar controls which are  initializing (BeginInit and EndInit) without any problem. Why is that ? From what I see AxMapControl is a .NET activex control.

I also tried SRI.ArcGIS.esriSystem.IAoInitialize aoInitialize = new ESRI.ArcGIS.esriSystem.AoInitializeClass(); option, and once I run aoInitialize.Initialize(arcview-license product code), I can see the esrilicensestatus as checked out. Even after that its still breaking at AxMapControl.EndInit().

Any ideas ?
0 Kudos
13 Replies
JohnHauck
Occasional Contributor II
You need an engine license to develop with the controls.

However, after you have created and deployed your application it can consume a Desktop license on your clients machine. It's just the developer machine that requires a license to develop with the controls.
0 Kudos
SumitSharma
New Contributor III
Hello,

ArcGIS engine developer kit license is required for engine development.
In order to run engine application, it will require engine runtime license but binding your product to ArcInfo license should also be able to run engine application.

Can you post your license initialization and binding code?

Cheers!!

Sumit
0 Kudos
AdityaTadakaluru
New Contributor
Hello

Thank you for you suggestions. I've arcgis engine developer license installed on my developer machine, everything runs fine on my developer machine since I have arcgis engine runtime installed too on that. But when I take the same application and run on a different machine (just winforms executable), its checking out the license which I can see after aoinitialize command using RunTimeManager.ActiveRuntime which is 'Desktop' but map component form is failing.

Below is my code

if (!RuntimeManager.Bind(ProductCode.EngineOrDesktop))
                throw new ArcGISNotFoundException();
            // Usual engine initialization code follows from here (AoInitialize).
            IAoInitialize init = new AoInitializeClass();
          
             if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeEngine) == esriLicenseStatus.esriLicenseAvailable)
            {
              init.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
             
            }
             else if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcView) == esriLicenseStatus.esriLicenseAvailable)
             {
                 init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView);
              }
             else if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcEditor) == esriLicenseStatus.esriLicenseAvailable)
             {
                 init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcEditor);
             }
             else if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcInfo) == esriLicenseStatus.esriLicenseAvailable)
             {
                 init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
             }
             else
             {
                 throw new ArcGISNotFoundException();
             }
0 Kudos
AdityaTadakaluru
New Contributor
0 Kudos
AlexanderGray
Occasional Contributor III
I have had this problem too.  If I select bind to desktop (not engine or desktop), it works.  In my case I only need to bind to desktop.  Binding to EngineOrDesktop causes as problem if the target machine has Engine installed but not licensed.   I found that if I did not have engine installed at all, it would bind to desktop and work ok.  You could verify what is installed before you bind.  I also had problems using engine mapcontrols with arcgis desktop if I had the preview in development environment option on (not sure why.)
0 Kudos
AdityaTadakaluru
New Contributor
tried just binding to desktop instead of engineordesktop. No luck !
0 Kudos
AdityaTadakaluru
New Contributor
Hello

I re-installed ArcGIS Desktop on the laptop, (no arcengine stuff installed). I ran my arcengine custom application and in my code I put
esriLicenseStatus status=  init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView);
              MessageBox.Show(status.ToString());
the status is printed as 'esriLicensceCheckedout'. So the AOIntializer in custom app is checking out the license but still the axMapControl.EndInit is failing. Any ideas?
0 Kudos
AlexanderGray
Occasional Contributor III
0 Kudos
AdityaTadakaluru
New Contributor
Below is my code

if (!RuntimeManager.Bind(ProductCode.EngineOrDesktop))
throw new ArcGISNotFoundException();
// Usual engine initialization code follows from here (AoInitialize).
IAoInitialize init = new AoInitializeClass();

if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeEngine) == esriLicenseStatus.esriLicenseAvailable)
{
init.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);

}
else if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcView) == esriLicenseStatus.esriLicenseAvailable)
{
init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView);
}
else if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcEditor) == esriLicenseStatus.esriLicenseAvailable)
{
init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcEditor);
}
else if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcInfo) == esriLicenseStatus.esriLicenseAvailable)
{
init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
}
else
{
throw new ArcGISNotFoundException();
}
0 Kudos