I have an open ticket with ESRI Support on this, but they don't seem to know what's going on, so maybe someone here can help. I'm guessing this is specific to the computer I am trying to run this on, I'm not having problems when using it on my laptop.
I cannot create/run any of the templates for ArcGIS Runtime SDK .NET in Visual Studio Community 2019. They throw exception errors. This is the out-of-the-box apps that are created in a new solution/project. I then loaded the ArcGIS Runtime SDK for .NET (WPF) from the Microsoft Store to see if I could get a sample to test. That also throws exception errors. Here's an example:
I have tried uninstalling EVERYTHING, including .NET, VS, ArcGIS Runtime nuget packages and reinstalling with no luck.
I am not running any anti-virus other than Windows Security. Turning off all Windows Security didn't fix it. ESRI Support tech had me downsize my screen resolution on 4k monitor and that didn't change anything either. He seems to think this is related to display/monitors since this happens when the mapview is called from a template app.
Thoughts? Other things to check?
If you create a completely new WPF Application, add the Esri.ArcGISRuntime.WPF nuget package, then just add this code:
When you run the template-based apps, what happens? (ie what exception, and where?)
Also could you try creating a .NET Core 3.0 WPF Application and do the same thing?
Do you also have the required VCLibs installed on your PC?
Which version of Windows are you using?
Thanks for sharing. The graphics card looks capable and the driver is up to date.
I'd appreciate it if you could try using internal method below to force Windows software rendering (as opposed to the default GPU hardware rendering) because this should finally rule out any issues with the GPU. In the WPF template, you could add this code in the App.Xaml.cs initialization:
API to force software rendering:
// Force software rendering
var forceWarpMethod = typeof(ArcGISRuntimeEnvironment)
.GetMethod("ForceDxSoftwareRendering", BindingFlags.NonPublic | BindingFlags.Static);
Thank you! Since Initialize succeeds, it means the deployment worked fine and you pre-reqs are met.
It appears the application crashes when trying to create the native view, which I haven't seen before.
One more thing you could try is:
- Go to the project settings and under debug tab, check on "Enable native code debugging".
- Set up the symbols server as described here: https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-net/blo...
Then re-run the application, and you should get a much better stacktrace of where it crashes.
Once it does crash, go to the Debug section in VS's file menu, and select "Save dump as...". If possible could you share that somewhere for me to download and send me a link (mnielsen (at) esri.com), and we can try and debug what is really happening.
Thank you for helping troubleshooting this.