Results 1 to 11 of 11

Thread: [RESOLVED] mscorlib.dll Error on some installations

  1. #1

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Resolved [RESOLVED] mscorlib.dll Error on some installations

    Background info: I have an app that I recently had to upgrade from VB6 to VS2008. It was only an upgrade so there are still some VB6 components in the app.

    My problem is that I get the following error from one of the forms in my app.

    Err Number: 5
    Source: mscrolib
    Err Decription: Exception has been thrown bt the target of an invocation.


    My problem is that I don't experience this error during debugging. Out of 20 computers 5 will have this error, the rest will be fine.

    The exception occurs when a form is opened that has:

    The form has an AxMSFlexgrid on it 2 textboxes and a command button.

    Can soemeone please guide me as to where to look for the problem, or a possible solution.

    The Problematic installations is running XP SP3 and .NET 3.5 SP1 (installed)
    Last edited by CherryPickle; Feb 5th, 2010 at 10:10 AM. Reason: More Info

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: mscorlib.dll Error on some installations

    usually an error 5 is an access denied error.

    How do you go about installing these applications to the end users? Have you made sure the flexgrid ocx control is on their system and registered?

    You could also try a repair or uninstall/reinstall of the framework, although 5 machines having a corrupted framework installation is less likely.

  3. #3

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: mscorlib.dll Error on some installations

    Was out for a while.

    I have tried un-install and re-install, I have done a repair install on .NET 3.5 SP1.
    I think the correct refferences are connected in VS2008. I allow VS to include everything that is required for the app when I publish.

    Visual studio includes 2 files for the flexgrid. These are:

    AxInterop.MSFlexGridLib.dll
    Interop.MSFlexGridLib.dll

    There are thus no flexgrid ocx. Do I need it in this case. I have searched my PC but cannot find an flexgrid ocx file only dll's

    My app makes use off the flexgrid on 4 forms, each of these forms gives the same error. I caught the exception on one of the forms telling me that the class is not registered.

    If this is the problem, how do I correct it? Since I use click once app and all the flexgrid dll's that I am aware off are included.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: mscorlib.dll Error on some installations

    From what I remember when I did VB6, it was MSFLXGRD.OCX and should live in c:\windows\system32. Check your dev box (or a box where it is working) and see if you in fact have this OCX file present. If you find that machines where this works has the OCX and machines where it doesn't work is missing the OCX file, then that would likely solve your problem. If you do need to copy the OCX file to the system32 folder, then you would need to also run 'regsvr32 msflxgrd.ocx' from a command prompt to register the control for COM in the registry. Once you did this, everything should work.

    Those 2 dll files you mention above are simply bridge DLLs. They are autogenerated by Visual Studio when you set a reference to a COM based control, and act as a bridge between this COM control and the managed .NET runtime. They are required for any .NET app working with a COM component. That does not negate the fact that the actual COM component does need to be on the machine though.

    Also, I don't believe you can register COM files or add them to system32 with clickonce. Chances are whatever users are NOT having the issue already have the flexgrid control from some previous application installation that also used it

  5. #5

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: mscorlib.dll Error on some installations

    Ok, I have checked one of the problem PC's. the OCX file was not on the computer or registered. I managed to succesfully register the OCX file. The error however remains.

    One of the forms returns an "Could not load file or assembly 'Interop.MSFlexgridLib'"

    I have uninstalled and re-installed my app, but still no success.
    Last edited by CherryPickle; Feb 5th, 2010 at 04:48 PM. Reason: More Info

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: mscorlib.dll Error on some installations

    are these 2 files

    AxInterop.MSFlexGridLib.dll
    Interop.MSFlexGridLib.dll

    included with your exe?

  7. #7

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: mscorlib.dll Error on some installations

    Yes, it is.

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: mscorlib.dll Error on some installations

    Can you verify the version of the flexgrid ocx file that you used on your development machine is the same as the one on the problem machine?

  9. #9

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: mscorlib.dll Error on some installations

    I have made sure it is the same version. I also tried different versions that I found on my PC, but still no success.

  10. #10

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: mscorlib.dll Error on some installations

    After much trial and error I figured out the following.

    What work for me:

    I installed a previous (VB6) version of the software, which seem to have succesfully registered the msflxgrd.ocx

    I also tried manually with the following command 'regsvr32 msflxgrd.ocx', Although windows told me registration was succesfull my app still could not find it.

    I am now creating a setup project in VS2008 and have included the "MSFLXGRD.OCX" file with the option vsdrfCOMSelfReg selected. Hope this will work.

  11. #11

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: mscorlib.dll Error on some installations

    My Solution did work. The "MSFLXGRD.OCX" was inserted in an setup project and I selected the auto register option. After the file registered my app ran just fine.
    RFor some this may be a basic execise, but I was not aware of this before.

    Thanx kleinma for pointing me in the right direction. Always good to learn something new.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width