none
Getting Errors on migrating Addin's Ribbon from .NET 3.5 to .NET4 RRS feed

  • Question

  • Hi All,

    I am developping an Excel Addin for Excel 2010 using C#. This addin contains a ribbon item.

    When I want to migrate my project from .Net 3.5 to .NET 4 I have changed the .NET version under project properties --> Application --> Target Framework and I reload it.

    I know that it is normal to get errors at moment compilation. But I have the same kind of errors in the Ribbon class and Ribbon Designer

    So, please tell me if there is a simple tip to resolve these problems or I am obliged to implement all required members in my Ribbon Class.

    I wonder also if the manner I used to migrate my project is correct or I have missed something?

    Thanks in advance.


    said

    Thursday, October 22, 2015 9:49 AM

Answers

All replies

  • Did you have a chance to check the references of the add-in project?

    Try to create a new add-in project and compare the resulted code. Do you see any difference?

    Thursday, October 22, 2015 10:22 AM
  • Hi,

    Thank you for the response.

    I have created a new add-in project based on .NET4

    So beside the custom references I have added to my project I can see that it contains the same references as the new project except "System.Core".

    When I tried to add it to my references I get the following error: "A reference to ‘System.core’ could not be added.  This component is already automatically referenced by the build system."

    So I closed my visual Studio Project, I add the reference via the (.csproj) file using notepad and I reopened the project.

    The reference was added correctly but I still get the same errors at the compilation moment.

    So please is there something else I can try?

    Thanks.


    said

    Thursday, October 22, 2015 11:26 AM
  • Hi said,

    We must make the following changes to our project code if the target framework is changed to .NET Framewrok 4 or later.

    l  Modify the Generated Ribbon code

    l  Modify any code that instantiates Ribbon controls at runtime, handles ribbon events, or sets the position of a Ribbon component programmatically.

    More information, please refer to:

    # Updating Ribbon Customizations in Office Projects that You Migrate to the .NET Framework 4 or the .NET Framework 4.5

    https://msdn.microsoft.com/en-us/library/ee712589.aspx?f=255&MSPPError=-2147217396

    On the other hand, there is a blog that may benefit you:

    # Fixing Compile and Run Time Errors after Retargeting VSTO Projects to the .NET Framework 4 (McLean Schofield)

    http://blogs.msdn.com/b/vsto/archive/2010/06/02/fixing-compile-and-run-time-errors-after-retargeting-vsto-projects-to-the-net-framework-4-mclean-schofield.aspx

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by saidOuarrich Friday, October 23, 2015 10:05 AM
    Friday, October 23, 2015 6:10 AM
    Moderator
  • Thank you Starain.

    The instructions in https://msdn.microsoft.com/en-us/library/ee712589.aspx?f=255&MSPPError=-2147217396 have resolved my problem


    said

    Friday, October 23, 2015 10:06 AM