아래의 프로그램은 예외를 throw합니다.C#의 geckoWebBrowser 예외를 초기화하십시오.
중국에서 번역private void Form1_Load(object sender, EventArgs e)
{
//Gecko.Xpcom.Initialize("D:\\xulrunner\\");
geckoWebBrowser1.Navigate("http://www.google.com");
}
예외는 다음과 같다 :
"시스템 .__하여 ComObject을 다음과 같이
static void Main()
{
Gecko.Xpcom.Initialize("D:\\xulrunner\\");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
에서 Form1.cs는 다음과 같이
Program.cs입니다 "변환 할 수 없습니다 인터페이스 유형 "Gecko.nsIWebNavigation"
예외는 t 그는 다음 코드를 :
public ChromeContext()
{
using (var appShallSvc = Xpcom.GetService2<nsIAppShellService>(Contracts.AppShellService))
{
webNav = appShallSvc.Instance.CreateWindowlessBrowser(true).AsComPtr(); //this is where the exception is thrown
webNav.Instance.LoadURI("chrome://global/content/alerts/alert.xul", 0, null, null, null);
}
}
어떤 도움을 주실 겁니다.
아마 XULRunner의 호환되지 않는 버전을 사용하고 있습니다. Geckofx와 XULRunner의 버전이 일치해야합니다. – vmas
XULRunner는 xulrunner-41.0b9.en-US.win32입니다. –
사용하는 geckofx가 xulrunner/firefox 주 버전과 일치하는 것이 매우 중요합니다. – vmas