So I have been building a “Game Launcher” in WPF form using C#, and it has been working fine, however now I have switched over to using CefSharp for the Web Browser component, due to limitations of the in-built IE one. Since then every time I Publish the ClickOnce and try to install, it installs fine, but will not open. I have checked Event logs and I can see the two following issues.
I have tried to rebuild .net and made sure i have all the required files as part of the Publish but still can’t seem to get it to work.
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
at System.Reflection.Assembly.Load(System.Reflection.AssemblyName)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType, Int16)
at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16)
at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
at System.Windows.Baml2006.Baml2006Reader.Read()
at System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader, System.Xaml.XamlObjectWriter, Boolean, Boolean, Boolean, System.Xaml.IXamlLineInfo, System.Xaml.IXamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack`1<System.Windows.Markup.WpfXamlFrame>, System.Windows.Markup.IStyleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
Exception Info: System.Windows.Markup.XamlParseException
at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__1_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at AussieAdventures_Game_Launcher.App.Main()
And also:
Faulting module name: KERNELBASE.dll, version: 10.0.18362.1, time stamp: 0x1a30e11b
Exception code: 0xe0434352
Fault offset: 0x000000000003a839
Faulting process id: 0x1224
Faulting application start time: 0x01d53ddd3ba81710
Faulting application path: C:\Users\%USERNAME%\AppData\Local\Apps\2.0\JB3QLMCD.VJM\3H1APX8K.J46\auss..tion_9e5937fe9f80aee9_0001.0001_024cc7db72a39b7c\AussieAdventures Game Launcher.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: e1cea3d5-5770-488c-9c3d-91c86fe438fb
Faulting package full name:
Faulting package-relative application ID:
If I build the app (rather than publish) and run it, it works fine. It only fails when using ClickOnce.
UPDATE:
@amaitland I did read that. I tried this, and it didn't seem to make any difference. (apologies, I’m still fairly new at this)
<Import Project="packages\CefSharp.Common.73.1.130\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.73.1.130\build\CefSharp.Common.targets')" />
<Import Project="packages\CefSharp.Wpf.73.1.130\build\CefSharp.Wpf.targets" Condition="Exists('packages\CefSharp.Wpf.73.1.130\build\CefSharp.Wpf.targets')" />
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x64.73.1.13\CEF\**\*" Exclude="$(SolutionDir)packages\cef.redist.x64.73.1.13\CEF\x64\**\*;$(SolutionDir)packages\cef.redist.x64.73.1.13\CEF\locales\**\*.pak">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
<Resource Include="aalogo_QMC_icon.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x64.73.1.13\CEF\**\en-US.*;$(SolutionDir)packages\cef.redist.x64.73.1.13\CEF\**\de.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\ccef.redist.x64.73.1.13\CEF\x64\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\CefSharp.Common.73.1.130\CefSharp\x64\**\CefSharp.BrowserSubprocess.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
</Target>```
User contributions licensed under CC BY-SA 3.0