• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 596
  • Last Modified:

.NET & Wacko web browser control

I have the Microsoft Web Browser control added to a form in a project, whenever I run the project in the IDE and open the form I get the following error:
"A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll.  Additional information: Unknown error."
Which then leads into:
"A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll.  Additional information: Marshaler restriction: Excessively long string."

If I double click the compiled EXE it works fine.

I have created a new blank project and done nothing other than add the Microsoft Web Browser control to the form and it does the same thing so I know it has nothing to do with my code.  And as I said, it only happens when I run inside the IDE, it is fine when compiled.
0
SkipFire
Asked:
SkipFire
  • 6
  • 5
1 Solution
 
Bob LearnedCommented:
What .NET version do you have?

Bob
0
 
SkipFireAuthor Commented:
I'm using Visual Studio .NET 2003 so v1.1.4322, however I also have 2005 installed so I also have v2.xxxx.
0
 
Bob LearnedCommented:
Do you have access to another machine?  Can this be duplicated on another machine?  It appears to be a problem with the COM components for the Web Browser control, but I don't specifically know what the solution is, until we narrow down the problem.

Bob
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
SkipFireAuthor Commented:
I'll bring another machine in tomorrow morning and try it.
0
 
SkipFireAuthor Commented:
I am not getting the error on another machine.
0
 
Bob LearnedCommented:
Proof that this is something wrong the configuration or DLLs.  The easy part is over, now down to the hard part--finding a solution.

Bob
0
 
Bob LearnedCommented:
You could try reinstalling Internet Explorer.

Bob
0
 
SkipFireAuthor Commented:
But why would it behave differently when running in the IDE than running compiled on the same machine?
0
 
Bob LearnedCommented:
Ok, so I missed that one.  Did you try removing the WebBrowser references, and readding the control?

Bob
0
 
SkipFireAuthor Commented:
Yeah, and I created an entirely new project with only a web browser control and no other code and it shows the same behavior.  Errors in the IDE, but works fine when compiled.
0
 
Bob LearnedCommented:
Check this:

Go to Debug |Exceptions

Check that Common Language Runtime Exceptions are set to
Continue "When the exception is thrown". In these conditions, my Windows
form loads without reporting an exception.

Bob
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now