none
Visual Studio Developer Preview install caused .NET Framework incompatibility RRS feed

  • السؤال

  • After installing Visual Studio Developer Preview I now notice that the System.Runtime.CompilerServices.ExtensionAttribute is no longer showing up in the System.Core assembly. We use PostSharp (and I'm sure other code), which relies on this attribute... is this an expected breaking change, or am I missing something?

    Installed on Windows 7 64bit machine.

    21/شوال/1432 04:20 م

الإجابات

  • Thank you for the feedback! I believe there are a few questions/topics here, let me try addressing them:

    The first topic is: ExtensionAttribute got moved. That’s indeed the case, it is now in mscorlib.dll, however, it was Type Forwarded from System.Core. That means that a binary that tried to look it up in System.Core.dll will be automatically given the mscorlib.dll definition. This is handled by the runtime, transparently.

    For more details about type forwarding, the MSDN article is a good start, but please feel free to ask directly (http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.typeforwardedtoattribute.aspx)

    What I’m trying to understand is how exactly PostSharp is failing – could you please provide more details around that?

    The second topic is: System.Core is installed in a 4.0 folder, not 4.5. That is correct. .NET 4.5 is an in-place release, not a side by side release.

    Finally: Tom, could you please detail what exactly got removed? Thanks!

    • تم وضع علامة كإجابة بواسطة KiddKane 03/ربيع الأول/1433 01:41 م
    24/شوال/1432 01:12 ص
  • Thanks for the additional data. I contacted Gael at SharpCrafters. When they are ready to look at Visual Studio 11, we would be more than happy to help with any issues they may encounter at the time.
    • تم وضع علامة كإجابة بواسطة KiddKane 03/ربيع الأول/1433 01:41 م
    24/شوال/1432 10:39 م

جميع الردود

  • This is part of mscorlib.dll instead of System.Core.dll in .NET 4.5.  See: http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.extensionattribute(v=VS.110).aspx

     

    Are you changing your dev. target to 4.5?  If so, I'd expect tools like PostSharp to break horribly, as they're not written to handle the new namespaces (yet)....

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    21/شوال/1432 04:40 م
    المشرف
  • Actually I made no change to targeting. So i was still targeting .NET 4.0.

    I ended up uninstalling the VS Preview and .NET 4.5. Which resulted in me having to reinstall Visual Studio 2010 and .NET 4.0 because Visual Studio 2010 would not open after uninstalling .NET 4.5.

    From what I can see it looks like .NET 4.5 replaced rather than added to the GAC since there is no C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Core\v4.5* folder but instead I noticed that the lone entry of System.Core.dll existed in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089. This sounds like a bug.

    21/شوال/1432 10:49 م
  • I'm having the exact same problem.  Additionally, it removed the "4.0" framework stuff from all my IIS App Pools....  nice "side-by-side" support... :(

     

    Turns out that I only had to re-install the Framework 4.0, not VS.NET in order to get back to running properly though.
    • تم التحرير بواسطة Tom McKearney 23/شوال/1432 06:11 م more info
    23/شوال/1432 05:32 م
  • Thank you for the feedback! I believe there are a few questions/topics here, let me try addressing them:

    The first topic is: ExtensionAttribute got moved. That’s indeed the case, it is now in mscorlib.dll, however, it was Type Forwarded from System.Core. That means that a binary that tried to look it up in System.Core.dll will be automatically given the mscorlib.dll definition. This is handled by the runtime, transparently.

    For more details about type forwarding, the MSDN article is a good start, but please feel free to ask directly (http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.typeforwardedtoattribute.aspx)

    What I’m trying to understand is how exactly PostSharp is failing – could you please provide more details around that?

    The second topic is: System.Core is installed in a 4.0 folder, not 4.5. That is correct. .NET 4.5 is an in-place release, not a side by side release.

    Finally: Tom, could you please detail what exactly got removed? Thanks!

    • تم وضع علامة كإجابة بواسطة KiddKane 03/ربيع الأول/1433 01:41 م
    24/شوال/1432 01:12 ص
  • I posted the error message I received in the PostSharp forums here: http://www.sharpcrafters.com/forum/Topic7568-20-1.aspx

    But the short of it is that it looks like PostSharp is performing some action which needs to access ExtensionAttribute.

    Error 17 Unhandled exception (2.0.8.1275, 64 bit, CLR 4.0, Release): PostSharp.Sdk.CodeModel.BindingException: Cannot find the type 'System.Runtime.CompilerServices.ExtensionAttribute' in assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
      at PostSharp.Sdk.CodeModel.AssemblyEnvelope.GetTypeDefinition(String typeName, BindingOptions bindingOptions)
      at PostSharp.Sdk.CodeModel.TypeRefDeclaration.GetTypeDefinition(BindingOptions bindingOptions)
      at PostSharp.Sdk.Extensibility.Tasks.AnnotationRepositoryTask.^wwGmHrz+(IAnnotationInstance _0)
      at PostSharp.Sdk.Extensibility.Tasks.AnnotationRepositoryTask.Execute()
      at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
      at PostSharp.Sdk.Extensibility.Project.Execute()
      at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
      at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) C:\development\Application\MyProject\POSTSHARP MyCompany.MyProject.Windows

    This is all specific to the PostSharp tool but the upshot seems to be in this case the type forwarding you guys did most certainly did not work.

    Gael from PostSharp probably has a better idea what is going on.

    24/شوال/1432 01:55 ص
  • Thanks for the additional data. I contacted Gael at SharpCrafters. When they are ready to look at Visual Studio 11, we would be more than happy to help with any issues they may encounter at the time.
    • تم وضع علامة كإجابة بواسطة KiddKane 03/ربيع الأول/1433 01:41 م
    24/شوال/1432 10:39 م