Menu Close

system.invalidoperationexception

A vb.net application program created using Microsoft Visual Studio .net 2005. When run the application program after successfully installed, the program crashes with the message of “EventType: Clr20r3. and P9: system.invalidoperationexception”.  Further infomation can be found in the application event log file of Windows XP. It said: “Source: .NET Runtime 2.0 Error, Event ID: 5000”. No further information is available.

Possible Reasons

  1. Some files needed for the application program are missing, such as dlls, etc.
  2. Some ocx, dll needed for the application program are not properly registered.
  3. Run a Microsoft .NET Framework 2.0-based application after you install security update MS 07-040 on a computer

Solutions:

 The solution for reason 1 is to find out the missing files and add them into the installation project.

The solution for reason 2 is to find out which ocx, dll etc have not been properly registered and register them properly.

The key point is how to find the missing files or controls. The method is:

  1. In VB.net 2005 project, open Application.Designer.vb in the subfolder of My Project of your application program.
  2. Add Imports System.Diagnostics to the top of the Application.Designer.vb
  3. Modify the Sub OnCreateMainForm() as following

 

<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _Protected Overrides Sub OnCreateMainForm()

Try

 Me.MainForm = Global.MyProjectName.StartFormName

Catch ex As Exception

EventLog.WriteEntry(“CaptureException”, ex.ToString)

End Try

End Sub

 

4. Rebuilt the set up file and run installation. Run the application program and the program crashes.

5. open Event log file, you will find the information you needed from now on.

 

 

 

5 comments on “system.invalidoperationexception

  1. What a great blog

  2. iuZaK50ZH7T on said:

    771783 423325This site is my breathing in, real wonderful style and perfect content material . 447916

  3. Pingback: URL

  4. You share interesting things here. I think that your blog can go viral easily,
    but you must give it initial boost and i
    know how to do it, just search in google –
    mundillo traffic increase

  5. My developer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using Movable-type on various websites for about
    a year and am worried about switching to another platform.
    I have heard great things about blogengine.net.
    Is there a way I can import all my wordpress posts into it?
    Any help would be greatly appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

18,519 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>