I've written an application in C# .NET with the WinForms UI toolkit. I'm attempting to provide Windows executables, but so far they simply don't work for anyone but me.
I'm creating the release packages by building the EXE and DLLs in Visual Studio 2017, copying them into one place, and putting that into a .zip archive. I'm not doing the fancy one-click publishing stuff.
The project is available on github (https://github.com/fadden/6502bench). The first person to try it got "<program> has stopped working" on Win7 (see issue). The second person was using Win10 Pro, and extracted some details from the event log that show it crashing in a system DLL (see issue). Both of them have the latest .NET framework installed.
I haven't worked with C# .NET outside Unity, so I'm a bit out of my depth. It's entirely possible I've skipped an "obvious" step, or am doing things wrong.
Update: answering some of the comments:
it's pure C#, no native or unsafe code
both people reporting problems confirmed that that latest .NET framework is installed (4.7.2)
the program doesn't seem to be starting at all, so I'm not sure what the app could be doing wrong as far as local paths go
the specific errors, including screen shots and log messages, are included in the issues linked above
the full source code, with the VS solution and projects, is up on github
The sense I'm getting from the comments is that what I'm doing isn't fundamentally wrong, so there's some devil in the details.
I downloaded the source, and debugged.
I received a StackOverFlowException on the following 2 lines of code.
ProjectView.cs
line 3545 : symbolListView.Columns[2].Width = lastWidth;
line 3719 : referencesListView.Columns[2].Width = lastWidth;
What is going on is you are handling the ColumnWidthChanged event on ListView components, and modifying the column width. This modification fires the event again, which is causing an infinite loop, and a subsequent StackOverflowException.
But why? I'll take a swing at an answer. You may have hard coded some values that line up with the DPI and resolution of your monitor. When the ListView instantiates on your machine, it doesn't have to 'redraw' the column with and does not fire the event, but for anyone else that doesn't have the same resolution and DPI, the event fires and causes the loop. I could be wrong, but sounds plausible to me.
I am trying to detect which version of IE an end-user has installed on their computer (My App uses WebBrowser control).
I need to know which version they are using which may not be as simple as
WebBrowser.Version
it seems that although that gives the version it does not tell us if the browser is actually using that version or a compatible version.
Also, With the WebBrowser.Version in hand, how would I go about deciding if this is the latest version of IE?
Any ideas, pointers - if not - tell a joke or something!
Cheers
Does people still use the Webbrowser control when things like Gecko and Webkit exists?
Anyways you can use the windows registry.
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Internet Explorer").GetValue("Version")
I would like to implement a web browser in my c#-program. The browser should cover some requirements:
It should be updateable
I'm not sure if this is possible, but it would be great if the implementet web-browser would alwasy be using the latest version of the based browser which is installed on the system.
Easy implementation
Of course, the easier to use, the better!
Security
And the used browser should be as secure as possible. The safest i could think of, was running the browser in sandboxed mode. Are there other possibilities to achieve a maxiumum of security?
Untill now i have found some wrappers for different Browser-Engines, but none of hem seems to match my requirements:
Awesomium: Is very easy to use! But is still based on an old Version of Chrome (12.0.702.0)
Berkelium: Same as Awesomium, i think.
CefSharp:
GeckoFX: Needs FireFox 1.5 installed
MozNet: Based on FireFox 3.6
WebKit.NET: I'm not sure about that...
the native WebBrowser Class: I think this is the best i could get - because it always uses the latest installed version of IE.
After doing some more research, i think i'll stick with the WebBrowser Control. It's not perfect and the posibilities to use own settings are not as good as i hoped, but i think since there seems no better solution, it will have to work...
I would like to build a browser extension for IE 7/8. I would like to do it using .NET. Do you know of any resources or tutorials that I could reference to do this? I haven't found much.
Thanks!
JP,
One of the main issues that makes IE extensions hard to develop is the need to develop with C, or .NET.
On the other side, FF and Chrome use (to some extent) JS, which is easier, and has a much lower entrance barrier (How many C "web developers" do you know?).
This is one of the issues / obstacle Crossrider is here to solve.
You can create your first IE plugin within minutes. It will save you a lot of research and development time, and you can write your code with Javascript.
On top of that, if you plan this plugin/extension to also work for browsers other than IE then you can develop a cross browser extension once, using an extensive unified API, and we will make it work for Chrome and Firefox.
Chrome and Firefox each one gets a a native extension file (CRX and XPI respectively) while IE a special EXE engine to run your app.
(Disclaimer: I'm a co-founder of Crossrider)
The same question that was asked two years later has the necessary answer. Everyone should refer to this question now:
How to get started with developing Internet Explorer extensions?
I'd love to know if there is such a thing as a Gecko.NET ;) I mean, just like we can embed a WebView and that is an "instance" of IE7 inside any Windows Forms application (and tell it to navigateto(fancy_url);). I'd love to use Firefox or WebKit.
Anybody tried this?
UPDATE: Please bear in mind that although it is possible to embed Gecko using the mentioned controls, it is still impossible to print while using Gecko.
UPDATE March 2010: It’s still not possible to print natively using GeckoFX, however a couple of methods exist that may be enough, depending upon what you’re trying to do.
See: http://geckofx.org/viewtopic.php?id=796 for more information.
UPDATE October 2013: I am no longer doing Windows development so I have no interest in this, but seems like the development of Gecko can be found here: https://bitbucket.org/geckofx and it seems to be recently updated. Leaving this here for future Windows devs ;)
UPDATE January 2017: I have gotten an email from a company called TeamDev. They created a Chromium-based .NET browser component called "DotNetBrowser" which can be used to display modern web pages in Windows Forms applications.
To quote the email directly:
Here are some details about the component, which might be helpful:
DotNetBrowser is based on Chromium, thus supporting HTML5, CSS3, JS and the latest web standards. The underlying Chromium version of the library is regularly updated.
The component is suitable for WPF as well as Windows Forms desktop applications, and works both for C# and VB.NET.
The library is licensed commercially, however free licences are provided for Open Source and academic projects.
Disclaimer: I have not used this DotNetBrowser for I no longer do Windows Development but may be worth checking if you're looking for a solution to this.
http://code.google.com/p/geckofx/
This is a nice .NET-wrapped version of Gecko
It certainly is possible. All you need to do is register the Mozilla ActiveX control (mozctlx.dll I believe), and you can drag it onto your form as any ActiveX control. The programming interface is similar (though not identical) to the IE one, and you can even use the Microsoft.MSHTML.dll managed library for control in some cases.
I believe this is packaged with Firefox. If not, you can get just the embeddable bits from Mozilla as well. Just do a Google search for Mozilla ActiveX control or Mozilla Embedding C# and that should take you down the right path.
GeckoFX is no longer being updated. The alternative is the MozNet XulRunner wrapper by Se7en Soft. MozNet has a ton of features that GeckoFX doesn't and is being actively updated and maintained.
I'd just like to point out, to all looking to embed Gecko into their applications, that the GeckoFX project appears to have been abandoned by its creators (Skybound Software). MozNET, while previously based on GeckoFX, sorta' picked up the ball and ran with it. It has the full ability to print, do print previews and allows you to set it all up via the native Windows print dialog, even - and a whole lot more.
OpenWebKitSharp is a wrapper arount the WebKit engine (nightly) and is very advanced. Take a look at here (OpenWebKitSharp section): http://code.google.com/p/open-webkit-sharp/
Update 2016:
BrowseEmAll.Gecko
A .Net component which can be used to integrate the Firefox engine into your .Net application. This is based on Geckofx but unlike the current version of Geckofx this will work with a normal release build of Firefox. To use Geckofx you will need to build Firefox yourself. Again commercial support is available but the component itself is fully open source.
(Full disclosure: I work for this company so take everything I say with a grain of salt)
#Martin: Yes, the Adam Locke version is outdated. But that's because a separate distribution is not necessary. It's built with the rest of the Mozilla codebase now.
If you download Prism (ie XulRunner), that will give you a base that you can customize to your needs, and this includes the most recent version of the control (in the \Prism\xulrunner directory, you'll find mozctlx.dll).
#Greg: Actually, it is an ActiveX control. Incidentally, all ActiveX controls are COM controls. ActiveX is built on COM.
As of October 30, 2011, there is new information to add since the time of the previous posts. Specifically, while Skybound stopped maintaining their version, there is at least one actively maintained, free, open-source fork available.
I'm using Hindle's fork at BitBucket, which, by virtue of his tool which parses XpCom idls and creates c# wrappers, is rapidly updated with support for each new version of Firefox/Gecko.
See this post for an overview of other choices.
Additionally, if you find yourself using Gtk instead of Windows.Forms, there is a tarball of webkit-sharp available that allows for easy embedding of WebViews into Gtk# applications.
I Belive "Gecko FX"[1] is the thing you need.
To Quote from the web site
"""
GeckoFX is a Windows Forms control written in clean, commented C# that embeds the Mozilla Gecko browser control in any Windows Forms Application. It also contains a simple class model providing access to the HTML and CSS DOM.
"""
1) I can't post a link as "new users aren't allowed to add hyperlinks" Search for "geckofx" on google code.