none
8013150A error when attempting to create a .NET object in VB6 RRS feed

  • General discussion

  • We are having a problem on one machine in our devlopment environment.  We currently have a VB6 project Creating .NET objects using .NET Interop.  All of the development machines should be configured identically.  However, on this one machine, we continually get the 8013150A error when attempting to set an object to the .NET object type.  Here is a code segment that I hope can explain it.

    Dim oApp As EHSInterfaces.IEHSApp

    '
    ' Create the caller specified IEHSApp object.
    ' The following call should fail if the caller asks us to create
    ' an object that does not implement the IEHSApp interface.
    '
    Set oApp = CreateObject(appObjName)

    The appObjName is a .NET class that implements the interface identified in the comment.  This one machine fails with a 'Type Mismatch' error.  All of the other machines have no problem.  If oApp is just defined as an object, the CreateObject works with no problem.  It is the cast to the interface that fails.

    Tuesday, November 3, 2009 7:18 PM

All replies

  • Hello Germantree

    I'm aware of these possible cause of the problem:

    1. CAS
    in .NET configuration tool: -> Runtime Security Policy ->Enterprise -> Code Groups -> All Code -> My Computer Zone ->Permissions Set: please set to FullTrust to see if it resolve the problem. It should be FullTrust by default.

    2.
    This problem reminds me of an old case that I once handled. In that case, the customer installed an update patch of .NET framework but did not succeed or did not install fully. After that, the customer starts to get the 8013150a error in his .NET interop calls. During research of .NET fusion log, I found that the mscorlib native image failed to load. The resolution was to uninstall and reinstall the .NET framework.

    3.
    http://heatherdotnet.blogspot.com/2007_04_01_archive.html
    an internal class may cause the error. However, as the problem happens only in one machine, this is not likely to be the cause in this case.

    Please let me know whether these suggestion help you.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, November 4, 2009 8:17 AM
    Moderator
  • Hello

    How are you? Could you please let me know whether the above suggestion help you?


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, November 10, 2009 11:53 AM
    Moderator
  • Sorry for the late reply.  We tried both items 1 and 2 with no luck.  As you said, item 3 didn't really apply since it was only 1 machine.  We appeciate the quick response to the question and all of the suggestions.
    Tuesday, November 10, 2009 12:27 PM
  • Hello

    If none of these suggestions help, I will have to dig into the .NET fusion log? Could you please send it to me? My email address is jialge@microsoft.com. Thanks in advance for your effort to collect the log information.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, November 10, 2009 12:31 PM
    Moderator
  • Hello

    How are you? I have not received the fusion log yet. If you meet with any difficulties to capture the log, please feel free to tell me.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, November 12, 2009 9:45 AM
    Moderator
  • We are changing the issue type to “General Discussion” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, November 16, 2009 1:53 PM
    Moderator