When I call sri.ArcGISRuntime.ArcGISRuntimeEnvironment.SetLicense(licenseString);The result is Exception thrown: 'System.InvalidOperationException' in WinRT.Runtime.dllPlease advice.
Well, I feel foolish. I had turned off Enable Just My Code for something else. The exception must be thrown in a lower library and caught. I'm unable to catch it and the license result comes back valid. Thank you for your time. Hopefully, this helps someone else.
If you put a try/catch around the SetLicense call, will you get a better exception in the catch? I've seen some issues with Microsoft not always handling un-caught exceptions that well
Thanks for responding quickly.
ArcGISRuntimeEnvironment.SetLicense(@runtimelite,1000,rud*****) is throwing System.InvalidOperationException: 'Operation is not valid due to the current state of the object.'
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
The stack trace is small. The HResult is -2147009196 if that helps at all.
Can you share the specific exception type, message and callstack?
We are seeing a similar exception. We are setting the license right before we initialize ArcGISRuntimeEnvironment. This is nearly the first thing we do during app startup. The ArcGISRuntimeEnvironment.IsInitialized is false just before setting the license. We are targeting C# .Net 8. If we don't try to set the license and just call ArcGISRuntimeEnvironment.Initialize() we don't see the exception. Any suggestions are appreciated.
Are you also seeing this if you just call ArcGISRuntimeEnvironment.Initialize() ?If so it's most likely an issue with the native libraries not getting deployed.What is your platform and target framework?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.