locked
VB6 to VB.Net - Unable to load MSCORLIB, Interop.StdType, AxSpin

    Question

  • I have been trying to use Artinsoft Visual Basic Upgrade Companion (Version 4) to convert VB6 code.  I am now getting the following error when I try to open the converted projects in Visual Studio 2010 and I look at the properties page for the project.

    An error occurred trying to load the page.  Could no resolve mscorlib for target framework ‘.NetFramework,Version=v4.0’.  This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.

    I have reloaded Visual Studio, Framework 3.5 SP1, and a number of other packages.  The properties page doesn't show any properties, just the error message.  The references show up correctly for the PInvoke project in the same solution.

     

    I am also getting the following three warnings in the error list for Visual Studio 2010.

    Could not load file or assembly ‘Interop.StdType,Version=2.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies.  The system cannot find the file specified.

     

    Cannot find wrapper assembly for type library “AxSpin”.

     

    The referenced component ‘AxSpin’ could not be found.

    The file Interop.StdType does appear in the obj/Debug directory.  Of course, I can't check the reference because I can't see the references for this project, only the error message above.

    Wednesday, September 08, 2010 7:12 PM

Answers

  • In this specific case, there was an issue with the tlbimp tool for the Spin control, and when we removed the reference to the AxSpin in the upgraded project, the mscorlib error disappeared.

    The issue could be caused by the machine configuration, but we are still investigating it.

     

    Best Regards,

    Esteban Villalobos | Migration Specialist |  ҉  ArtinSoft | w www.artinsoft.com

     

    Friday, September 17, 2010 12:06 AM

All replies

  • Hi Bradley,

     

    This root cause is likely the upgraded VS2010 VB.Net project was targeted to “.Net Framework 4 Client Profile” by default. Please double check the app.config file under Solution Explorer pane as below.

    <?xml version="1.0"?>

    <configuration>

        <startup>

            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>

        </startup>

    </configuration>

    If yes, please edit the app.config file to target to “.Net Framework 4” like this:

    <?xml version="1.0"?>

    <configuration>

        <startup>

            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

        </startup>

    </configuration>

    .NET Framework 4 Client Profile http://msdn.microsoft.com/en-us/library/cc656912.aspx

    The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications.  If you are targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4.

     

    By the way, if Project Properties window can work fine on your machine, you can check the target framework like this:
    Project menu -> Properties ->  Compile tab -> Advanced Compile Options -> Target Framework

     

    Best regards,

    Martin Xie

    MSDN Subscriber Support in Forum

    If you have any feedback on 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, September 09, 2010 4:43 AM
  • I checked and that line was in the app.config files.  However, one project didn't appear to have app.config.  I'll look at that in more detail.
    Thursday, September 09, 2010 1:40 PM
  • In this specific case, there was an issue with the tlbimp tool for the Spin control, and when we removed the reference to the AxSpin in the upgraded project, the mscorlib error disappeared.

    The issue could be caused by the machine configuration, but we are still investigating it.

     

    Best Regards,

    Esteban Villalobos | Migration Specialist |  ҉  ArtinSoft | w www.artinsoft.com

     

    Friday, September 17, 2010 12:06 AM