GeckoWebBrowser crash in anyCPU










0















In a C# .Net 4.7.2 WPF project, I'm loading the GeckoWebBrowser component from a UserControl. I'm using the nuget package id="Geckofx60.64" version="60.0.18" .



My solution and project are configured with "Any CPU" in VS2017.



In order to get the Firefox64 repository, I add the nuget package id="Geckofx60.64.Windows" version="0.7.0".



Everything is OK, then I'm calling an "index.html" page with the following code



public partial class Simulator : UserControl

readonly string indexPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Templates", "index.html");

private GeckoWebBrowser _browser;

public Simulator()

InitializeComponent();
Xpcom.Initialize("Firefox64");

var host = new WindowsFormsHost();
_browser = new GeckoWebBrowser();

host.Child = _browser;
GridWeb.Children.Add(host);


private void Datacontext_ConfigurationChanged(object sender, System.EventArgs e)

Dispatcher.Invoke(() =>
_browser.Navigate(indexPath)
);


private void Simulator_OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)

var datacontext = DataContext as ServicesViewModel;
if (datacontext != null)

datacontext.ConfigurationChanged -= Datacontext_ConfigurationChanged;
datacontext.ConfigurationChanged += Datacontext_ConfigurationChanged;





The logic in my application is to refresh the browser each time I have some changes in my local objects.



Datacontext_ConfigurationChanged will be called for each change.



It's working pretty well except that I can receive this exception randomly during a refresh



"System.AccessViolationException: Attempted to read or write protected memory.."


This exception crashes my app, and I can't find any solution for this exception.
Thank you for your help !










share|improve this question
























  • I see you're using x64 geckofx binaries, but using AnyCPU. Have you turned off "Prefer 32-bit" in the build settings? Its on by default. If you haven't, its trying to run as 32 bit instead of 64 bit.

    – Joel Lucsy
    Nov 14 '18 at 15:56











  • Hi, thank you, but "Prefer 32-bit" is not checked (for all projects) in build settings.

    – Jérôme
    Nov 14 '18 at 16:34











  • System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

    – Jérôme
    Nov 19 '18 at 12:54
















0















In a C# .Net 4.7.2 WPF project, I'm loading the GeckoWebBrowser component from a UserControl. I'm using the nuget package id="Geckofx60.64" version="60.0.18" .



My solution and project are configured with "Any CPU" in VS2017.



In order to get the Firefox64 repository, I add the nuget package id="Geckofx60.64.Windows" version="0.7.0".



Everything is OK, then I'm calling an "index.html" page with the following code



public partial class Simulator : UserControl

readonly string indexPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Templates", "index.html");

private GeckoWebBrowser _browser;

public Simulator()

InitializeComponent();
Xpcom.Initialize("Firefox64");

var host = new WindowsFormsHost();
_browser = new GeckoWebBrowser();

host.Child = _browser;
GridWeb.Children.Add(host);


private void Datacontext_ConfigurationChanged(object sender, System.EventArgs e)

Dispatcher.Invoke(() =>
_browser.Navigate(indexPath)
);


private void Simulator_OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)

var datacontext = DataContext as ServicesViewModel;
if (datacontext != null)

datacontext.ConfigurationChanged -= Datacontext_ConfigurationChanged;
datacontext.ConfigurationChanged += Datacontext_ConfigurationChanged;





The logic in my application is to refresh the browser each time I have some changes in my local objects.



Datacontext_ConfigurationChanged will be called for each change.



It's working pretty well except that I can receive this exception randomly during a refresh



"System.AccessViolationException: Attempted to read or write protected memory.."


This exception crashes my app, and I can't find any solution for this exception.
Thank you for your help !










share|improve this question
























  • I see you're using x64 geckofx binaries, but using AnyCPU. Have you turned off "Prefer 32-bit" in the build settings? Its on by default. If you haven't, its trying to run as 32 bit instead of 64 bit.

    – Joel Lucsy
    Nov 14 '18 at 15:56











  • Hi, thank you, but "Prefer 32-bit" is not checked (for all projects) in build settings.

    – Jérôme
    Nov 14 '18 at 16:34











  • System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

    – Jérôme
    Nov 19 '18 at 12:54














0












0








0








In a C# .Net 4.7.2 WPF project, I'm loading the GeckoWebBrowser component from a UserControl. I'm using the nuget package id="Geckofx60.64" version="60.0.18" .



My solution and project are configured with "Any CPU" in VS2017.



In order to get the Firefox64 repository, I add the nuget package id="Geckofx60.64.Windows" version="0.7.0".



Everything is OK, then I'm calling an "index.html" page with the following code



public partial class Simulator : UserControl

readonly string indexPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Templates", "index.html");

private GeckoWebBrowser _browser;

public Simulator()

InitializeComponent();
Xpcom.Initialize("Firefox64");

var host = new WindowsFormsHost();
_browser = new GeckoWebBrowser();

host.Child = _browser;
GridWeb.Children.Add(host);


private void Datacontext_ConfigurationChanged(object sender, System.EventArgs e)

Dispatcher.Invoke(() =>
_browser.Navigate(indexPath)
);


private void Simulator_OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)

var datacontext = DataContext as ServicesViewModel;
if (datacontext != null)

datacontext.ConfigurationChanged -= Datacontext_ConfigurationChanged;
datacontext.ConfigurationChanged += Datacontext_ConfigurationChanged;





The logic in my application is to refresh the browser each time I have some changes in my local objects.



Datacontext_ConfigurationChanged will be called for each change.



It's working pretty well except that I can receive this exception randomly during a refresh



"System.AccessViolationException: Attempted to read or write protected memory.."


This exception crashes my app, and I can't find any solution for this exception.
Thank you for your help !










share|improve this question
















In a C# .Net 4.7.2 WPF project, I'm loading the GeckoWebBrowser component from a UserControl. I'm using the nuget package id="Geckofx60.64" version="60.0.18" .



My solution and project are configured with "Any CPU" in VS2017.



In order to get the Firefox64 repository, I add the nuget package id="Geckofx60.64.Windows" version="0.7.0".



Everything is OK, then I'm calling an "index.html" page with the following code



public partial class Simulator : UserControl

readonly string indexPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Templates", "index.html");

private GeckoWebBrowser _browser;

public Simulator()

InitializeComponent();
Xpcom.Initialize("Firefox64");

var host = new WindowsFormsHost();
_browser = new GeckoWebBrowser();

host.Child = _browser;
GridWeb.Children.Add(host);


private void Datacontext_ConfigurationChanged(object sender, System.EventArgs e)

Dispatcher.Invoke(() =>
_browser.Navigate(indexPath)
);


private void Simulator_OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)

var datacontext = DataContext as ServicesViewModel;
if (datacontext != null)

datacontext.ConfigurationChanged -= Datacontext_ConfigurationChanged;
datacontext.ConfigurationChanged += Datacontext_ConfigurationChanged;





The logic in my application is to refresh the browser each time I have some changes in my local objects.



Datacontext_ConfigurationChanged will be called for each change.



It's working pretty well except that I can receive this exception randomly during a refresh



"System.AccessViolationException: Attempted to read or write protected memory.."


This exception crashes my app, and I can't find any solution for this exception.
Thank you for your help !







c# geckofx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 7:46







Jérôme

















asked Nov 14 '18 at 15:13









JérômeJérôme

1047




1047












  • I see you're using x64 geckofx binaries, but using AnyCPU. Have you turned off "Prefer 32-bit" in the build settings? Its on by default. If you haven't, its trying to run as 32 bit instead of 64 bit.

    – Joel Lucsy
    Nov 14 '18 at 15:56











  • Hi, thank you, but "Prefer 32-bit" is not checked (for all projects) in build settings.

    – Jérôme
    Nov 14 '18 at 16:34











  • System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

    – Jérôme
    Nov 19 '18 at 12:54


















  • I see you're using x64 geckofx binaries, but using AnyCPU. Have you turned off "Prefer 32-bit" in the build settings? Its on by default. If you haven't, its trying to run as 32 bit instead of 64 bit.

    – Joel Lucsy
    Nov 14 '18 at 15:56











  • Hi, thank you, but "Prefer 32-bit" is not checked (for all projects) in build settings.

    – Jérôme
    Nov 14 '18 at 16:34











  • System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

    – Jérôme
    Nov 19 '18 at 12:54

















I see you're using x64 geckofx binaries, but using AnyCPU. Have you turned off "Prefer 32-bit" in the build settings? Its on by default. If you haven't, its trying to run as 32 bit instead of 64 bit.

– Joel Lucsy
Nov 14 '18 at 15:56





I see you're using x64 geckofx binaries, but using AnyCPU. Have you turned off "Prefer 32-bit" in the build settings? Its on by default. If you haven't, its trying to run as 32 bit instead of 64 bit.

– Joel Lucsy
Nov 14 '18 at 15:56













Hi, thank you, but "Prefer 32-bit" is not checked (for all projects) in build settings.

– Jérôme
Nov 14 '18 at 16:34





Hi, thank you, but "Prefer 32-bit" is not checked (for all projects) in build settings.

– Jérôme
Nov 14 '18 at 16:34













System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

– Jérôme
Nov 19 '18 at 12:54






System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

– Jérôme
Nov 19 '18 at 12:54













1 Answer
1






active

oldest

votes


















1














I changed to Geckofx45.64 and now it's ok..






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303342%2fgeckowebbrowser-crash-in-anycpu%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I changed to Geckofx45.64 and now it's ok..






    share|improve this answer



























      1














      I changed to Geckofx45.64 and now it's ok..






      share|improve this answer

























        1












        1








        1







        I changed to Geckofx45.64 and now it's ok..






        share|improve this answer













        I changed to Geckofx45.64 and now it's ok..







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 23 '18 at 15:46









        JérômeJérôme

        1047




        1047



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303342%2fgeckowebbrowser-crash-in-anycpu%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            政党

            天津地下鉄3号線