none
Visual Studio 2015 and Excel AddIn. Is not possible to reference a shared project library RRS feed

  • Question

  • hy,

    i'm starting to develop Excel+Word+Outlook AddIn in C# on Visual Studio 2015 to provide the same user experience using each of these software. To optimize and reduce code to write I thought to create 3 addins projects (one for each above software) and a single shared project where I want to put common code and resources. When I tried to reference shared project in every AddIn project I find out that this features is not permits, or rather when i click on add reference library in each AddIn project, in the left pane of reference manager dialog box there is not Shared projects choice. This is a bug?

    Best Regards

    Rolando

    Tuesday, August 25, 2015 4:41 PM

Answers

  • >>>So the only workaround is to create an intermediate class library, reference shared library into it

    Base on my testing, you couldn't  add reference shared project into class library, so I suggest you could use class library directly.

    Friday, September 11, 2015 7:42 AM

All replies

  • Hello Ronaldo,

    What is the target .net framework for your add-ins?

    Tuesday, August 25, 2015 5:14 PM
  • .NET 4.5 and Excel 2013 AddIn Thanks Eugene
    Tuesday, August 25, 2015 6:39 PM
  • You can add multiple Shared Projects to your solution, and you can reference multiple Shared Projects from a project.
    Make sure that the Shared Project and the project that you are referencing it from are using the same language.

    For more information, click here to refer about Shared Project Reference Manager

    Monday, August 31, 2015 7:04 AM
  • Hy David,

    Is not true. I have create an .NET 4.5 Excel Add-In Project in C# language. Next I have create a classic class Library in C# and .NET 4.5 and, finally a shared project for .NET 4.5. if I open Reference Manager form Class Library I see image 1:

    Instead if I open Reference manger from ExcelAdd-in project I see image 2:

    where, as you can see, in the left column of this window, there isn't shared Project choice.

    In the next image there is Solution tree.

    I hope to be able to explain my issue.

    Best Regards, Rolando

    Monday, August 31, 2015 3:01 PM
  • Visual Studio 2015 and Excel AddIn is not possible to reference a shared project library

    Shared Projects in Visual Studio 2015 RTM
    New templates are available to create empty shared projects for Visual Basic, C#, and JavaScript. These shared projects can now be referenced by several project types:
    •Any un-flavored VB/C# projects (e.g. console apps, class libraries, Win form app)
    •Windows Store 8.1 and Windows Phone 8.1 (VB/C#/JavaScript)
    •Windows Phone Silverlight 8.0/8.1 (VB/C#)
    •WPF and PCL

    For more information, click here to refer about Visual Studio 2015 RTM

    Tuesday, September 8, 2015 7:08 AM
  • Dea David,

    I don't understand what do you mean. Do you confirm that in VS 2015 is not possible to reference directlya shared library in a Office Add-In Project?

    If so, why it was possible in VS 2013 and now it isn't in VS 2015? Do you know why?

    Best Regards Rolando

    Tuesday, September 8, 2015 1:32 PM
  • >>>I don't understand what do you mean. Do you confirm that in VS 2015 is not possible to reference directlya shared library in a Office Add-In Project?

    In Visual Studio 2015 RTM, I haven't find Shared Project that support Office Add-In Project type,
    otherwise I have installed Visual Studio 2015 and reproduced this same issue base on these steps that you have described.

    You can add/remove references to shared projects via the Reference Manager, on the Shared Projects tab. The shared project reference shows up under the References node in the Solution Explorer, but the code and assets in the shared project are treated as if they were files linked into the main project.

    But you couldn't find Shared Projects tab when you try to add references to shared projects via the Reference Manager in your Office Add-In Project.

    Wednesday, September 9, 2015 9:44 AM
  • Hy David,

    So the only workaround is to create an intermediate class library, reference shared library into it and, next step, reference the intermediate class library into each Office Add-In Project (like Excel, Word, Outlook.. etc..) that i need to create.

    Is it right?

    Wednesday, September 9, 2015 10:12 AM
  • >>>So the only workaround is to create an intermediate class library, reference shared library into it

    Base on my testing, you couldn't  add reference shared project into class library, so I suggest you could use class library directly.

    Friday, September 11, 2015 7:42 AM