Code52 / DownmarkerWPF

MarkPad - a visual Markdown editor (inspired by the Downmarker project)
http://code52.org/DownmarkerWPF/
Microsoft Public License
1.4k stars 460 forks source link

Preview keeps loading (Windows 2012) #386

Closed sanderd closed 11 years ago

sanderd commented 11 years ago

With the latest stable and nightly, I can't get preview to work on Windows 2012. It's pretty much a vanilla Windows 2012 install, so I doubt it's a configuration-wise conflict.

I do have IIS and some other services running in the background.

Attached is a screenshot - keeps saying 'Preview loading...' in the right pane. This for new documents, as well as .md files opened from file system / web.

I have also tested the same versions on Windows XP (don't ask :(), where it does work as expected.

preview_loading

sanderd commented 11 years ago

Update: installed Awesomium 1.7.1.0 SDK and changed the references of MarkPad.PreviewControl. Seems to fix the issue. Wondering if nightly crashing is because of incomplete distribution of DLLs or general incompatibility with Windows 2012.

Managed to get a stack trace. Awesomium.dll is present in the debug bin folder though.

System.TypeInitializationException was unhandled by user code
  HResult=-2146233036
  Message=The type initializer for 'Awesomium.Core.WebCore' threw an exception.
  Source=Awesomium.Core
  TypeName=Awesomium.Core.WebCore
  StackTrace:
       at Awesomium.Core.WebCore.CreateWebSession(String dataPath, WebPreferences prefs)
       at MarkPad.PreviewControl.AwesomiumHost.ControlLoaded(Object sender, RoutedEventArgs e) in c:\Users\sanderd\Desktop\DownmarkerWPF-master\src\MarkPad.PreviewControl\AwesomiumHost.cs:line 60
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.FrameworkElement.OnLoaded(RoutedEventArgs args)
       at MS.Internal.FrameworkObject.OnLoaded(RoutedEventArgs args)
       at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
       at System.Windows.BroadcastEventHelper.BroadcastLoadedSynchronously(DependencyObject rootDO, Boolean isLoaded)
       at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
       at MS.Internal.LoadedOrUnloadedOperation.DoWork()
       at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
  InnerException: System.TypeInitializationException
       HResult=-2146233036
       Message=The type initializer for 'Awesomium.Core.NativeMethods' threw an exception.
       Source=Awesomium.Core
       TypeName=Awesomium.Core.NativeMethods
       StackTrace:
            at Awesomium.Core.NativeMethods.Initialize()
            at Awesomium.Core.WebCore.zq6qKUXMAPKIMPK0EYS()
            at Awesomium.Core.WebCore..cctor()
       InnerException: System.TypeInitializationException
            HResult=-2146233036
            Message=The type initializer for 'AweExceptionHelper' threw an exception.
            Source=Awesomium.Core
            TypeName=AweExceptionHelper
            StackTrace:
                 at Awesomium.Core.NativeMethods.AweExceptionHelper..ctor()
                 at Awesomium.Core.NativeMethods.Initialize()
                 at Awesomium.Core.NativeMethods..cctor()
            InnerException: System.DllNotFoundException
                 HResult=-2146233052
                 Message=Unable to load DLL 'awesomium.dll, Awesomium.Core, Version=1.7.0.5, Culture=neutral, PublicKeyToken=e1a0d7c8071a5214': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
                 Source=Awesomium.Core
                 TypeName=""
                 StackTrace:
                      at Awesomium.Core.NativeMethods.AweExceptionHelper.RegisterExceptionCallbacks_awesomium(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
                      at Awesomium.Core.NativeMethods.AweExceptionHelper..cctor()
                 InnerException: 
JakeGinnivan commented 11 years ago

Thanks for the stack trace!

http://answers.awesomium.com/questions/400/index.html explains the issue. Another thread at http://answers.awesomium.com/questions/141/crashing-in-awesomiumnet-wpf-control-on-win-xp.html but I am trying the workaround from the first post.

Basically if you dont have the directx redistributables installed, it crashes. I have included the missing dll in the clickonce installer.

Hopefully this fixes it

sanderd commented 11 years ago

I have just retested on my 2012 Server (one without the Awesomium SDK, and indeed no DirectX installed). Nightly I had installed while reporting the issue was still not working. After the update to latest nightly, it works as it should!

Seems like you've hammered down the issue :) Thanks!