Could not load ArcGIS Runtime (RuntimeCoreNet.dll)

306
0
03-25-2020 07:36 AM
Highlighted
New Contributor

Working with WPF .net Core 3.1 and Esri Map. When installing on computers not running VS we get this error:

Application: Volcano.MappingHost.exe CoreCLR Version: 4.700.19.60701 .NET Core Version: 3.1.1 Description: The process was terminated due to an unhandled exception. Exception Info: Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'MappingModule'. - The exception message was: An exception has occurred while trying to add a view to region 'MapContentRegion'. - The most likely causing exception was was: 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: Set property 'Prism.Mvvm.ViewModelLocator.AutoWireViewModel' threw an exception. ---> System.TypeInitializationException: The type initializer for 'RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase' threw an exception. ---> System.InvalidOperationException: Could not load ArcGIS Runtime (RuntimeCoreNet.dll) or one of its dependencies. Ensure "Microsoft Visual C++ 2015-2019 Redistributable" is installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B) at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.CoreRT_ArcGISRuntimeEnvironment_setInstallDirectory(Byte[] installPath, IntPtr& outErrorHandle) at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.SetInstallDirectory(String installPath) at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize() --- End of inner exception stack trace --- at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.InitNative() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.OnBeforeFirstUseOfGeneratedWrapper() at RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase..cctor() --- End of inner exception stack trace --- at RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreColor..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreRGBColor..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreRGBColor..ctor(Byte red, Byte green, Byte blue, Byte alpha) at Esri.ArcGISRuntime.Internal.GraphicUtils.FromColorToCore(Color color) at Esri.ArcGISRuntime.Symbology.SimpleFillSymbol..ctor(SimpleFillSymbolStyle style, Color color, LineSymbol outline) at Volcano.Module.Mapping.MapCore.MapViewController..ctor(IEventAggregator eventAggregator) in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\MapCore\MapViewController.cs:line 21 --- End of inner exception stack trace --- at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at Volcano.Module.Mapping.Views.VolcanoMapView.InitializeComponent() at Volcano.Module.Mapping.Views.VolcanoMapView..ctor() in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\Views\VolcanoMapView.xaml.cs:line 9 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Unity.Processors.ConstructorProcessor.<>c__DisplayClass16_0.<GetResolverDelegate>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.UnityContainer.<>c__DisplayClass111_0.<OptimizingFactory>b__0(BuilderContext& c) at Unity.Strategies.BuildPlanStrategy.PreBuildUp(BuilderContext& context) at Unity.UnityContainer.<>c.<.ctor>b__73_1(BuilderContext& context) at Unity.UnityContainer.Unity.IUnityContainer.Resolve(Type type, String name, ResolverOverride[] overrides) at Prism.Unity.UnityServiceLocatorAdapter.DoGetInstance(Type serviceType, String key) at CommonServiceLocator.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)'. But also check the InnerExceptions for more detail or call .GetRootException(). - The Assembly that the module was trying to be loaded from was:Volcano.Module.Mapping, Version=1.0.22.0, Culture=neutral, PublicKeyToken=null Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem. ---> Prism.Regions.ViewRegistrationException: An exception has occurred while trying to add a view to region 'MapContentRegion'. - The most likely causing exception was was: 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: Set property 'Prism.Mvvm.ViewModelLocator.AutoWireViewModel' threw an exception. ---> System.TypeInitializationException: The type initializer for 'RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase' threw an exception. ---> System.InvalidOperationException: Could not load ArcGIS Runtime (RuntimeCoreNet.dll) or one of its dependencies. Ensure "Microsoft Visual C++ 2015-2019 Redistributable" is installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B) at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.CoreRT_ArcGISRuntimeEnvironment_setInstallDirectory(Byte[] installPath, IntPtr& outErrorHandle) at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.SetInstallDirectory(String installPath) at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize() --- End of inner exception stack trace --- at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.InitNative() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.OnBeforeFirstUseOfGeneratedWrapper() at RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase..cctor() --- End of inner exception stack trace --- at RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreColor..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreRGBColor..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreRGBColor..ctor(Byte red, Byte green, Byte blue, Byte alpha) at Esri.ArcGISRuntime.Internal.GraphicUtils.FromColorToCore(Color color) at Esri.ArcGISRuntime.Symbology.SimpleFillSymbol..ctor(SimpleFillSymbolStyle style, Color color, LineSymbol outline) at Volcano.Module.Mapping.MapCore.MapViewController..ctor(IEventAggregator eventAggregator) in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\MapCore\MapViewController.cs:line 21 --- End of inner exception stack trace --- at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at Volcano.Module.Mapping.Views.VolcanoMapView.InitializeComponent() at Volcano.Module.Mapping.Views.VolcanoMapView..ctor() in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\Views\VolcanoMapView.xaml.cs:line 9 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Unity.Processors.ConstructorProcessor.<>c__DisplayClass16_0.<GetResolverDelegate>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.UnityContainer.<>c__DisplayClass111_0.<OptimizingFactory>b__0(BuilderContext& c) at Unity.Strategies.BuildPlanStrategy.PreBuildUp(BuilderContext& context) at Unity.UnityContainer.<>c.<.ctor>b__73_1(BuilderContext& context) at Unity.UnityContainer.Unity.IUnityContainer.Resolve(Type type, String name, ResolverOverride[] overrides) at Prism.Unity.UnityServiceLocatorAdapter.DoGetInstance(Type serviceType, String key) at CommonServiceLocator.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)'. But also check the InnerExceptions for more detail or call .GetRootException(). ---> CommonServiceLocator.ActivationException: Activation error occurred while trying to get instance of type VolcanoMapView, key "" ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: Set property 'Prism.Mvvm.ViewModelLocator.AutoWireViewModel' threw an exception. ---> System.TypeInitializationException: The type initializer for 'RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase' threw an exception. ---> System.InvalidOperationException: Could not load ArcGIS Runtime (RuntimeCoreNet.dll) or one of its dependencies. Ensure "Microsoft Visual C++ 2015-2019 Redistributable" is installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B) at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.CoreRT_ArcGISRuntimeEnvironment_setInstallDirectory(Byte[] installPath, IntPtr& outErrorHandle) at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.SetInstallDirectory(String installPath) at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize() --- End of inner exception stack trace --- at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.TryInitialize() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.InitNative() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize() at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.OnBeforeFirstUseOfGeneratedWrapper() at RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase..cctor() --- End of inner exception stack trace --- at RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreColor..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreRGBColor..ctor(IntPtr handle) at RuntimeCoreNet.GeneratedWrappers.CoreRGBColor..ctor(Byte red, Byte green, Byte blue, Byte alpha) at Esri.ArcGISRuntime.Internal.GraphicUtils.FromColorToCore(Color color) at Esri.ArcGISRuntime.Symbology.SimpleFillSymbol..ctor(SimpleFillSymbolStyle style, Color color, LineSymbol outline) at Volcano.Module.Mapping.MapCore.MapViewController..ctor(IEventAggregator eventAggregator) in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\MapCore\MapViewController.cs:line 21 --- End of inner exception stack trace --- at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at Volcano.Module.Mapping.Views.VolcanoMapView.InitializeComponent() at Volcano.Module.Mapping.Views.VolcanoMapView..ctor() in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\Views\VolcanoMapView.xaml.cs:line 9 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Unity.Processors.ConstructorProcessor.<>c__DisplayClass16_0.<GetResolverDelegate>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.Processors.MemberProcessor`2.<>c__DisplayClass8_0.<GetResolver>b__0(BuilderContext& c) at Unity.UnityContainer.<>c__DisplayClass111_0.<OptimizingFactory>b__0(BuilderContext& c) at Unity.Strategies.BuildPlanStrategy.PreBuildUp(BuilderContext& context) at Unity.UnityContainer.<>c.<.ctor>b__73_1(BuilderContext& context) at Unity.UnityContainer.Unity.IUnityContainer.Resolve(Type type, String name, ResolverOverride[] overrides) at Prism.Unity.UnityServiceLocatorAdapter.DoGetInstance(Type serviceType, String key) at CommonServiceLocator.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) --- End of inner exception stack trace --- at CommonServiceLocator.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) at CommonServiceLocator.ServiceLocatorImplBase.GetInstance(Type serviceType) at Prism.Regions.RegionViewRegistry.CreateInstance(Type type) at Prism.Regions.RegionViewRegistry.<>c__DisplayClass8_0.<RegisterViewWithRegion>b__0() at Prism.Regions.Behaviors.AutoPopulateRegionBehavior.OnViewRegistered(Object sender, ViewRegisteredEventArgs e) --- End of inner exception stack trace --- at Prism.Regions.RegionViewRegistry.OnContentRegistered(ViewRegisteredEventArgs e) at Prism.Regions.RegionViewRegistry.RegisterViewWithRegion(String regionName, Func`1 getContentDelegate) at Prism.Regions.RegionViewRegistry.RegisterViewWithRegion(String regionName, Type viewType) at Prism.Regions.RegionManager.RegisterViewWithRegion(String regionName, Type viewType) at Volcano.Module.Mapping.MappingModule.OnInitialized(IContainerProvider containerProvider) in D:\Projects\VolcanoMapping\Volcano.Module.Mapping\MappingModule.cs:line 26 at Prism.Modularity.ModuleInitializer.Initialize(IModuleInfo moduleInfo) --- End of inner exception stack trace --- at Prism.Modularity.ModuleInitializer.HandleModuleInitializationError(IModuleInfo moduleInfo, String assemblyName, Exception exception) at Prism.Modularity.ModuleInitializer.Initialize(IModuleInfo moduleInfo) at Prism.Modularity.ModuleManager.LoadModulesThatAreReadyForLoad() at Prism.Modularity.ModuleManager.LoadModulesWhenAvailable() at Prism.Modularity.ModuleManager.Run() at Prism.PrismApplicationBase.InitializeModules() at Prism.PrismApplicationBase.Initialize() at Prism.PrismApplicationBase.InitializeInternal() at Prism.PrismApplicationBase.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__1_0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run() at Volcano.MappingHost.App.Main() in D:\Projects\VolcanoMapping\Volcano.MappingHost\obj\Release\netcoreapp3.1\win-x64\App.g.cs:line 62

We do not encounter when running in VS debugging.

Any ideas as to why the RuntimeCoreNet.dll can't be found as we have verified it's existence after the install is complete.

Reply
0 Kudos
0 Replies