Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core 3.0 WPF self-contained app crashes on start #91

Closed
mahoekst opened this issue Sep 25, 2018 · 1 comment
Closed

.NET Core 3.0 WPF self-contained app crashes on start #91

mahoekst opened this issue Sep 25, 2018 · 1 comment

Comments

@mahoekst
Copy link

dotnet new WPF
open project in VS2017 preview
Build and run app works fine
Publish, change profile to self-contained
double click the exe. app crashes without seeing any UI

Application Error 1000
Faulting application name: netcorewpf.exe, version: 0.0.0.0, time stamp: 0x5ba8632c
Faulting module name: KERNELBASE.dll, version: 10.0.17763.1, time stamp: 0x30bd5043
Exception code: 0xe0434352
Fault offset: 0x0011aaf2
Faulting process id: 0x3e88
Faulting application start time: 0x01d45523c916af67
Faulting application path: C:\scratch\netcorewpf\bin\Release\netcoreapp3.0\win-x86\netcorewpf.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: e86dcdad-6d14-4469-91e2-64ecb2712fca
Faulting package full name:
Faulting package-relative application ID:

.NET Runtime 1026
Application: netcorewpf.exe
CoreCLR Version: 4.6.26921.6
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException: The type initializer for 'System.Windows.Window' threw an exception. ---> System.InvalidProgramException: Failed WPF DLL consistency checks. Expected location: C:\Users\mahoekst.nuget\packages\runtime.win-x86.microsoft.desktopui.app\3.0.0-alpha-26921-3\runtimes\win-x86\lib\netcoreapp3.0.
DLL Name: PresentationNative_cor3.dll DLL Location: C:\Users\mahoekst.nuget\packages\runtime.win-x86.microsoft.desktopui.app\3.0.0-alpha-26921-3\runtimes\win-x86\native

at System.Windows.WpfDllVerifier.VerifyWpfDllSet(String[] additionalDlls) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\WpfDllVerifier.cs:line 117
at System.Windows.Window..cctor() in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Window.cs:line 121
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Markup\XamlReader.cs:line 416
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Markup\WpfXamlLoader.cs:line 154
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Markup\WpfXamlLoader.cs:line 39
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Markup\XamlReader.cs:line 981
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 666
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 614
at System.Windows.Application.DoStartup() in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 1678
at System.Windows.Application.<.ctor>b__1_0(Object unused) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 201
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) in E:\A_work\160\s\src\WPF\src\WindowsBase\MS\Internal\Threading\ExceptionWrapper.cs:line 104
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) in E:\A_work\160\s\src\WPF\src\WindowsBase\MS\Internal\Threading\ExceptionWrapper.cs:line 37
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 3121
at System.Windows.Threading.DispatcherOperation.InvokeImpl() in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\DispatcherOperation.cs:line 583
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\DispatcherOperation.cs:line 527
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) in E:\A_work\160\s\src\WPF\src\Shared\MS\Internal\CulturePreservingExecutionContext.cs:line 234
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) in E:\A_work\160\s\src\WPF\src\Shared\MS\Internal\CulturePreservingExecutionContext.cs:line 185
at System.Windows.Threading.DispatcherOperation.Invoke() in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\DispatcherOperation.cs:line 438
at System.Windows.Threading.Dispatcher.ProcessQueue() in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 2271
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 2509
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in E:\A_work\160\s\src\WPF\src\Shared\MS\Win32\HwndWrapper.cs:line 345
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) in E:\A_work\160\s\src\WPF\src\Shared\MS\Win32\HwndSubclass.cs:line 494
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) in E:\A_work\160\s\src\WPF\src\WindowsBase\MS\Internal\Threading\ExceptionWrapper.cs:line 104
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) in E:\A_work\160\s\src\WPF\src\WindowsBase\MS\Internal\Threading\ExceptionWrapper.cs:line 37
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 3121
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 1449
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 1161
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) in E:\A_work\160\s\src\WPF\src\Shared\MS\Win32\HwndSubclass.cs:line 392
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 2482
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 2332
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 370
at System.Windows.Threading.Dispatcher.Run() in E:\A_work\160\s\src\WPF\src\WindowsBase\System\Windows\Threading\Dispatcher.cs:line 329
at System.Windows.Application.RunDispatcher(Object ignore) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 2782
at System.Windows.Application.RunInternal(Window window) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 1858
at System.Windows.Application.Run(Window window) in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 269
at System.Windows.Application.Run() in E:\A_work\160\s\src\WPF\src\PresentationFramework\System\Windows\Application.cs:line 231
at netcorewpf.App.Main()

@mahoekst
Copy link
Author

Never mind, upgrade VS2017 preview to preview 2 and now it works. Although it doesn't create a single .exe at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant