Select to view content in your preferred language

Deploy .NET WPF application

140
6
Friday
JustinTrody
New Contributor

Hi I am using Visual Studio 2022 to build a .net wpf application using some online samples.

I have created a setup project and created an MSI, which I am trying to install on a Windows 10 machine.

I have Windows Desktop Runtime 8.07 (both 32 and 64 bit), Visual C++ Redistributable 2015-2022 (both 32 and 64 bit), .net framework 4.8x installed

I have tried setting Target Platform as Any CPU or x86 or x64

I have installed the app. When running the app, it doesn't work. I am getting errors  in Event Viewer:

Has anyone come across similar issues. Any suggestions ?

I previously tried using Click Once. This works, but app is not installed in standard folder for all users.

Application: OfflineTrace.exe
CoreCLR Version: 8.0.1124.51707
.NET Version: 8.0.11
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'Esri.ArcGISRuntime.UI.Controls.MapView' that matches the specified binding constraints threw an exception.
---> System.TypeInitializationException: The type initializer for 'Esri.ArcGISRuntime.UI.Controls.GeoView' threw an exception.
---> System.InvalidOperationException: Cannot initialize GeoView. Shaders not found in arcgisruntime200.3\resources\shaders
at Esri.ArcGISRuntime.UI.Controls.GeoView..cctor()
--- End of inner exception stack trace ---
at Esri.ArcGISRuntime.UI.Controls.GeoView.GetInitialDpi()
at Esri.ArcGISRuntime.UI.Controls.MapView.CreateCoreMapView()
at Esri.ArcGISRuntime.UI.Controls.MapView..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
--- 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.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
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 ---
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 OfflineTraceToolkit.App.Main()

0 Kudos
6 Replies
JustinTrody
New Contributor

Just adding also, I don't see  arcgisruntime200.3\resources\shaders on my install folder. Am I missing something obvious here. The app works fine when run in VS 2022 Community.                                      Hi @dotMorten_esri , have you come across this before ? Thanks

0 Kudos
dotMorten_esri
Esri Notable Contributor

That definitely indicates an issue with deployment and would also explain the above error. Do you happen to have a small simple project you can share that reproduces the issue? I wonder if it's some sort of project configuration issue.

0 Kudos
JustinTrody
New Contributor
  1. @dotMorten_esri , I have a small project created in VS 2022 to reproduce the issue . Please let me know how I can share project
    CoreCLR Version: 8.0.1124.51707
    .NET Version: 8.0.11
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'Esri.ArcGISRuntime.UI.Controls.MapView' that matches the specified binding constraints threw an exception.
    ---> System.TypeInitializationException: The type initializer for 'Esri.ArcGISRuntime.UI.Controls.GeoView' threw an exception.
    ---> System.InvalidOperationException: Cannot initialize GeoView. Shaders not found in arcgisruntime200.3\resources\shaders
    at Esri.ArcGISRuntime.UI.Controls.GeoView..cctor()
    --- End of inner exception stack trace ---

 

 

0 Kudos
JustinTrody
New Contributor

Thanks. I'll try a with small project and share. Is there a documentation on how to deploy an app using ArcGIS .net SDK using Setup project. i.e. what are the dependencies etc

0 Kudos
JustinTrody
New Contributor

I have this resolved now. Setup was missing the ArcGISRuntime folder. This is required. Thanks

 

PreetiMaske
Esri Regular Contributor

Hi Justin,

We are curious to try this approach in house. Would like to know what tool you are using to generate the .msi or the final setup project?

0 Kudos