none
Visual Studio 2012 Does Not Allow Unit Test Project to Reference Project Created from Excel 2013 Workbook Project Template RRS feed

  • Question

  • While I can add a Unit Test project to my VS 2012 Excel 2013 Workbook solution, the Excel 2013 Workbook project does not show up in the Reference Manager dialog window.  Why is this?  Further VS 2012 does not allow for the referencing of the Excel 2013 Workbook project DLL either.  So, what is my path forward for unit testing the logic within my Excel 2013 Workbook project?

    Thank you,

    Dan

    Monday, October 28, 2013 12:25 AM

Answers

  • Hi Dan,

    Thanks very much for your feedback.

    Technically, we are able reference an Excel Add-In dll. But Office Add-In project is used to develop an Office Add-In, and it is not supposed to be referenced by other .NET project. But if it is feature you want to include, please feel free to submit your feedback to User Voice.

    As we can see from the figure below, an Excel Add-In assembly should be loaded by the Office Application.

    In unit-test, the assembly is loaded by Visual Studio Test System. Even you could reference the Excel Add-In assembly to your unit-test project, the code interacting with Office Application would never work.

    >> So, what is my path forward for unit testing the logic within my Excel 2013 Workbook project? <<

    Usually, we will put the business code into a Class Library project separately (e.g.: “BusnessLogic.proj”). After that, the business logic code would be more re-usable (it is not binding to the Office solution) and you can test it without the Office application.


    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.

    Tuesday, October 29, 2013 1:45 PM
    Moderator

All replies

  • Hi Dan,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some time.
    Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards

    Fei


    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.

    Tuesday, October 29, 2013 4:35 AM
    Moderator
  • Hi Dan,

    Thanks very much for your feedback.

    Technically, we are able reference an Excel Add-In dll. But Office Add-In project is used to develop an Office Add-In, and it is not supposed to be referenced by other .NET project. But if it is feature you want to include, please feel free to submit your feedback to User Voice.

    As we can see from the figure below, an Excel Add-In assembly should be loaded by the Office Application.

    In unit-test, the assembly is loaded by Visual Studio Test System. Even you could reference the Excel Add-In assembly to your unit-test project, the code interacting with Office Application would never work.

    >> So, what is my path forward for unit testing the logic within my Excel 2013 Workbook project? <<

    Usually, we will put the business code into a Class Library project separately (e.g.: “BusnessLogic.proj”). After that, the business logic code would be more re-usable (it is not binding to the Office solution) and you can test it without the Office application.


    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.

    Tuesday, October 29, 2013 1:45 PM
    Moderator