Select to view content in your preferred language

SetLicense and empty map

845
6
09-15-2023 10:34 AM
sylvainc
New Contributor II

Hello,

I have developed my WinUI application in developer mode withe API key settings and it works fine:

protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
ArcGISRuntimeEnvironment.ApiKey = "xxxx";


m_window = new MainWindow();
m_window.Activate();
}

I want to prepare its release and added the Litelicense code available here: here  as follow:

protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
// Note: it is not best practice to store API keys in source code.
// The API key is referenced here for the convenience of this tutorial.
ArcGISRuntimeEnvironment.ApiKey = "xxx";
ArcGISRuntimeEnvironment.SetLicense("runtimelite,1000,yyyy");

m_window = new MainWindow();
m_window.Activate();
}

but now my mapview is empty...


What am I doing wrong?

Tags (1)
0 Kudos
6 Replies
PreetiMaske
Esri Regular Contributor

Are you getting any load errors on your map? You could perhaps check Map's load status and check why is map failing to load.

My suspicion is either you map is secured or API key is conflicting with your License string. Remove API key from the code and try just the license string.

API Key 

0 Kudos
sylvainc
New Contributor II

Thank you.

I have removed the API key and checked the map status. I have the following:

ArcGIS Maps SDK: Load Error: Map
Esri.ArcGISRuntime.ArcGISRuntimeException
Unlicensed feature.

So,the license string I got from here seems to be the issue.

The license string looks like "runtimelite,1000,rudxxxx,none,1JPyyyy". If I replace "none" by some dates, it works but then I have the "Licensed for Developer Use only" being displayed.What am I doing wrong? Shouldn't the license string from the link above work without editing?

Thank you

0 Kudos
PreetiMaske
Esri Regular Contributor

That License string in the sample code is just a dummy string. You need to put in an actual license string. For information on how to get a license for use in production app please see https://developers.arcgis.com/net/license-and-deployment/get-a-license/

0 Kudos
PreetiMaske
Esri Regular Contributor
0 Kudos
sylvainc
New Contributor II

Thank you for your feedback.

The lite license string is not a dummy string as it is only shown after being authenticated. Another post (https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-runtimelite-license-with-the-new-sit...) seems to indicate that I am getting the lite license string from the correct location.

Why do I keep getting this:

ArcGIS Maps SDK: Load Error: Map
Esri.ArcGISRuntime.ArcGISRuntimeException
Unlicensed feature.


When I am providing my Runtime lite license string from what the good webpage: https://developers.arcgis.com/net/license-and-deployment/get-a-license/#your-lite-license-string

 

Thank you for your help

0 Kudos
PreetiMaske
Esri Regular Contributor

Unlicensed feature error indicates that there are components in your map that requires more than current license level. So if you are using a valid lite license then perhaps your map contains something that requires more than lite license level.

You can review capabilities available in each license level https://developers.arcgis.com/net/license-and-deployment/license-levels-and-capabilities/

Or if you like you can share you map/app with me at pmaske@esri.com and I will be happy to take a look.

0 Kudos