Hello,
For my current projet (in .Net 4.8 - Visual Studio 2017), I chosen to develop a "Esri map" component in an another projet, with Visual Studio 2019.
I used "create project" window and I had select "ArcGIS Runtime WPF App (.NET) (Esri)".
But, I can't use this projet (.Net 5) in my main projet (.Net 4.8). I have modified .csproj file to replace "<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>" by "<TargetFramework>net48</TargetFramework>" but I have this error when i affect ArcGISRuntimeEnvironment.ApiKey :
System.InvalidOperationException
HResult=0x80131509
Message=Could not load ArcGIS Runtime (RuntimeCoreNet100_14.dll) or any of its dependencies. Make sure the "Microsoft Visual C++ 2015-2019 Redistributable" component is installed.
Source=Esri.ArcGISRuntime
Procedure call tree :
at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize()
at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.InitNative()
at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.InitializeRuntimeCore()
at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.set_ApiKey(String value)
Internal exception 1 :
BadImageFormatException: Attempting to load an incorrect format program. (Exception from HRESULT : 0x8007000B)
I know this error is due to my modification but it says that the ArcGIS framework is available since the .Net Framework 4.6.1 .
https://developers.arcgis.com/net/reference/system-requirements/#wpf-requirements
.NET SDKs
- .NET SDK 6.0.201 or higher - .NET 6.0 Target Framework net6.0-windows10.0.18362.0 or higher
- .NET Framework 4.6.1 or higher
Have you an idea for my problem ?
Thanks !
Solved! Go to Solution.
Hello,No, I use two versions of Visual Studio: 2019 (for the map) and 2017 (my main project).
I found a solution with starting a new project (for the map) with VS2017 but without a model (need to modify some files to be able to load the data).
For the moment, it works.
Hi,
The Visual Studio extension with project templates does not support VS 2017: it only supports VS 2019 and VS 2022. In fact I'm a little surprised you were able to install into VS 2017, it should prevent this from happening which is something we'll need to investigate.
If you're starting a new project now, we highly recommend VS 2022 and .NET 6.
Thanks
Hello,No, I use two versions of Visual Studio: 2019 (for the map) and 2017 (my main project).
I found a solution with starting a new project (for the map) with VS2017 but without a model (need to modify some files to be able to load the data).
For the moment, it works.
The template installer for WPF only comes with .NET 6 support and requires VS2022. This is because the We a few years ago removed the .NET Framework templates to be in line with the Microsoft recommendation to not use .NET Framework for new work.
To use .NET Framework, instead create a blank WPF .NET Framework application and add the Esri.ArcGISRuntime.WPF NuGet package (this should even work in VS2017, although we don't officially support/test it). Just changing the framework in the SDK-style project isn't fully supported with .NET Framework. It's possible but might cause a few headaches (you could try adding <PlatformTarget>AnyCPU</PlatformTarget> to the PropertyGroup, and it might resolve this specific issue but I'd still recommend starting with the blank wpf templates instead)