Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0'

Answered Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0'

  • Friday, November 12, 2010 10:35 AM
     
     

    I have developed a WF4 solution on a 32-bit Windows Server 2008 environment running the .NET 4 framework and Visual Studio 2010 Ultimate. Because also BizTalk is installed on that box, those prerequisites are installed as well (like VS 2008).

    Now I had a new 64 bit machine ready with Windows Server 2008 R2 and BizTalk 2010, so with only VS 2010 and all other BizTalk 2010 prerequisites.

    I wanted to continue development on that Workflow Service on the new machine. Opening the solution in VS2010 was not a problem, but when I tried to open the XAMLX file on the new server, I ran into this error. Strange thing is that if I create a new Workflow Service in VS2010, it runs just fine.

    Can anybody help me with this? The solutions presented in other discussions couldn't help me.

    System.InvalidOperationException: Could not 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.

    Server stack trace:
       at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUniverse..ctor(IDesignTimeAssemblyLoader assemblyLoader, IVsDesignTimeAssemblyResolution projectAssemblyResolution, IVsSmartOpenScope dispenser)
       at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUniverse.GetUniverse(IDesignTimeAssemblyLoader assemblyLoader, IVsDesignTimeAssemblyResolution projectAssemblyResolution, IVsSmartOpenScope dispenser)
       at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkProvider..ctor(IVsDesignTimeAssemblyResolution assemblyResolution, IDesignTimeAssemblyLoader assemblyLoader, TypeDescriptionProvider parentProvider, IVsSmartOpenScope openScope)
       at Microsoft.VisualStudio.Activities.AddIn.WorkflowDesignerAddIn.get_TargetFrameworkProvider()
       at Microsoft.VisualStudio.Activities.AddIn.WorkflowDesignerAddIn.SetDesignerEventsSink(IProcessDesignerEventsAddInView designerEventsSink)
       at Microsoft.VisualStudio.Activities.AddInAdapter.IDesignerContractToViewAddInAdapter.SetDesignerEventsSink(IProcessDesignerEventsContract designerEventsContract)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.VisualStudio.Activities.DesignerContract.IDesignerContract.SetDesignerEventsSink(IProcessDesignerEventsContract designerEventsContract)
       at Microsoft.VisualStudio.Activities.HostAdapter.IDesignerViewToContractHostAdapter.SetDesignerEventsSink(IProcessDesignerEventsHostView designerEventsHostView)
       at Microsoft.VisualStudio.Activities.EditorPane.CreateWorkflowDesignerInIsolatedMode()

    • Moved by Figo Fei Thursday, November 18, 2010 5:57 AM (From:Visual Studio Setup and Installation)
    •  

All Replies

  • Monday, November 15, 2010 7:21 AM
     
     

    Hi Jean-Paul,

    Can you take the .NET Framework verification tool to check the installation on the machine: http://blogs.msdn.com/b/astebner/archive/2010/05/13/10012778.aspx?

    Please try to repair/reinstall .NET Framework 4.0 and try again.

    If the problem persists, please let me know.

    Thanks.
     


    Figo Fei
    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.
  • Wednesday, November 17, 2010 9:01 PM
     
     

    Hi Figo,

    I did both the verification (which was successful) and the repair, but still the same result.

    Any other ideas?

    Thanks for you help.

     

  • Thursday, November 18, 2010 5:57 AM
     
     

    Hi Jean-Paul,

    Moved to WWF 4.0 forum for better suggestion/answer.

    Thanks for your understanding.


    Figo Fei
    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.
  • Thursday, November 18, 2010 7:21 AM
    Moderator
     
     

    This reminds me one one other thread on the forum Executable load problem when linking in assemblies from previous CLR versions.
    In that thread the problem seemed to be the app.config file or other .config file specifying a specific runtime version. The file may have been generated from a beta version of VS or similar.

    The other place I would look at are differences between your .csproj file and the standard .csproj in the new project template, as it is unlikely that your XAMLX itself specifies a versioned or strong assembly name.

    Any help?
    Tim

  • Tuesday, December 07, 2010 12:38 AM
    Moderator
     
     
    Did you manage to resolve the problem?
    Tim
  • Saturday, September 01, 2012 7:42 PM
     
     Answered

    Hi, I had this same error that didn't make any sense as my solution worked before and I made no changes to the .Net framework nor installed any updates. Note: I had no apostrophe in my user name or the path.

    I found this article and even though I am not on XP but on Windows 7 I found the resolution of my problem here:

    http://wcfvs.blogspot.com/2011/04/could-not-resolve-mscorlib-for-target.html

    Basically, if the path to the file is too long or contains characters like apostrophe you may get that .Net 4.0 framework error, that is lame as

    the problem had nothing to do with the .Net framework setup.

    Shorten the path and/or remove apostrophe from the path is what seems to be the solution to the problem.

    Hope this helps others.