When I call sri.ArcGISRuntime.ArcGISRuntimeEnvironment.SetLicense(licenseString);
The result is Exception thrown: 'System.InvalidOperationException' in WinRT.Runtime.dll
Please advice.
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?
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.
Can you share the specific exception type, message and callstack?
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.
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
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.