none
Error Building Outlook AddIn in TFS RRS feed

  • Question

  • I am trying to build an Outlook AddIn via TFS. I have registered the Outlook PIA (Microsoft.Office.Interop.Outlook) in the GAC as per this post after initially getting the error described there, however, I am now getting the following error:

    C:\Program Files
    (x86)\MSBuild\Microsoft\VisualStudio\v9.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets
    (160): The "RegisterFormRegions" task's outputs could not be retrieved from the
    "FormRegionNamesAndMessageClasses" parameter. Parameter "includeEscaped" cannot
    have zero length.

    I've found another forum post that describes the same problem but it's not clear from that what the solution is.

    My project includes a Form Region, however, I don't want to register in the registry at build time, surely that's an install-time operation?

    Any help would be much appreciated.

    Kevan

    Tuesday, March 13, 2012 9:12 AM

All replies

  • Hi kevan,

    Thanks for posting in the MSDN Forum.

    I have no TFS environment on my side. I will involve some experts into this thread to see whether they can help you. Here might be some time delay, appreciate for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 15, 2012 6:03 AM
    Moderator
  • Hi, As we see in answer of this thread, RegisterFormRegions has two functions.  Since you have formregion in the project, you cannot diable the RegisterFormRegions task or only apply one of the function. In other words, the formregion registry entry will be written at build time anyway.

    To build VSTO addin on team build machine, people need follow below steps, and the whole process is already be automated.  You can refer to: http://msdn.microsoft.com/en-us/library/ff624126.aspx
    1.Install Team Build software
    2.Install Windows SDK to get GACUTIL and SignTool.
    3.Install Visual Studio Tools for Office 2010 Runtime
    4.Install Custom Build Tasks and Targets
    •Microsoft.VisualStudio.Tools.Office.BuildTasks.dll (v10.0)
    •Microsoft.VisualStudio.Tools.Applications.BuildTasks.dll (v10.0)
    •Microsoft.VisualStudio.Tools.Office.targets

    5.  Copy Reference Assemblies
    •%Program Files%\Reference Assemblies\Microsoft\VSTA30\*.dll
    •%Program Files%\Reference Assemblies\Microsoft\VST040\*.dll

    6.  Copy Primary Interop Assemblies
    •%Program Files(x86)%\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\*.dll

    7.  Copy Bootstrapper Packages
    •%Program Files%\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\VSTOR40\*
    •%Program Files%\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\Office2007PIARedist\*

    8.  Add registry keys under
    •[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx]

    •[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework v4.0.30319\AssemblyFoldersEx]

    9.  Specify the following MSBuild Arguments in the Build definition to publish the Office Project:
    /target:publish /property:PublishDir="MyServer\Drops\ Publish\\"

    Hope your query will be clear soon.


    Forrest Guo | MSDN Community Support | Feedback to us

    Thursday, March 15, 2012 3:11 PM
    Moderator
  • Thanks for the information Forrest, however I have checked and all that is in place. In fact we have Visual Stuido 2010 installed on the build machine.
    Friday, March 16, 2012 10:01 AM
  • So it becomes easier.  We need to setup the build machine same as a development machine, that being said,

    • Install Office 2007; make sure PIA are installed correctly in GAC
    • Install Visual Studio 2008; make sure we build Outlook addin project in Visual Studio successfully. I suppose you use Visual Studio 2008 as indicated in the error message, V9.0 path

    If build in VS without exception, and only fail to build in team build, please copy and paste the build log over here on the forum. People will help analyze it.

    Hope your question will be clear soon. :)


    Forrest Guo | MSDN Community Support | Feedback to us

    • Proposed as answer by Forrest GuoModerator Friday, March 23, 2012 1:29 AM
    • Marked as answer by Bruce Song Wednesday, April 4, 2012 6:25 AM
    • Unmarked as answer by kevan_b Monday, April 16, 2012 3:25 PM
    Friday, March 16, 2012 3:15 PM
    Moderator
  • Thanks for the suggestion, I'll give it a go. Yes it builds in VS2008 on my machine but the build server uses Team Build 2010.

    VS2008 Team System Development Edition is installed on the build server but Outlook 2007 is not installed.

    I tried loading the project in VS2008 on the server but when I load the project it says:

    Warning    1    This project requires Microsoft Office Outlook 2007 and the registered primary interop assemblies, but these are not installed.

    Warning    2    This project references the primary interop assembly for Microsoft Office Outlook 2007, but this primary interop assembly is not installed.

    However, I have installed the PIAs, I have checked the GAC and the correct versions are there. When I check the VS2008 About box, the following is in the list of installed programs:

    Microsoft Visual Studio 2008 Tools for Office   91904-270-8048915-60812

    Friday, March 23, 2012 1:43 PM
  • Hi, Kevan

    It turned out that you installed PIAs without Office, which is not expected. On both development machine, and VSTO solution runtime, Office product is required.  VSTO addin is to extend Office functionality.

    regards,


    Forrest Guo | MSDN Community Support | Feedback to us

    Friday, March 23, 2012 3:07 PM
    Moderator
  • Hi Forrest

    Sorry for the delay in coming back to you with this.

    Yes I originally installed the Outlook PIA on the build machine. The build machine is purely used for building so surely it shouldn't need Office installed just to build? However, in order to try to sort this problem I have now installed Office 2007 and I still get the same error message:

    C:\Program Files
    (x86)\MSBuild\Microsoft\VisualStudio\v9.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets
    (160): The "RegisterFormRegions" task's outputs could not be retrieved from the
    "FormRegionNamesAndMessageClasses" parameter. Parameter "includeEscaped" cannot
    have zero length.

    Any ideas?

    Kevan

    Monday, April 16, 2012 3:46 PM
  • Hi,

    Yes, you're right.  Office software is not required on build agent.  However, I'm confused at the software configuration on build agent:

    • In your reply on Mar 16, you mentioned VS 2010 installed on build agent;
    • In reply on Mar 23, you mentioned VS 2008 installed

    As you know there's limitation on forum platform, we are not able to talk online.  Due to complexity of this issue, it falls into paid support category which requires higher level support. Please visit the below link to see the various support options that are available to better meet your needs.
    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    thanks and regards,


    Forrest Guo | MSDN Community Support | Feedback to manager

    Tuesday, April 17, 2012 2:16 AM
    Moderator
  • We've got VS Team Build 2010 installed which is what I'm trying to build with, we've also got VS2008 Team System Development Edition installed. We now have both versions of Office (2007 and 2010) installed.

    As I said in my original post, this post describes exactly my problem, however, the reply suggests "changing the Build Task source code" I don't understand what source code needs changing.

    Does the RegisterFormRegions task not work on 2010? Do I actually need that task in my build target? since as I said at the beginning, on the build machine I don't need to register the form regions.

    Tuesday, April 17, 2012 7:03 AM
  • Hi,

    Do not install Office 2007 and 2010 side by side. This is not supported scenario.  On build agent, neither of them is required. You could find a list of prerequisites at my first reply.

    This should build successfully. Anyway, I have created a connect report about this issue.  Please review it and let me know if any information inaccurate.  https://connect.microsoft.com/VisualStudio/feedback/details/737313/tfs-2010-build-failure-outlook-2007-vs2008-addin-with-formregion

    thanks and regards,


    Forrest Guo | MSDN Community Support | Feedback to manager

    Tuesday, April 17, 2012 2:39 PM
    Moderator
  • Hi Forrest

    Thanks for the reply and for raising the connect report.

    I'll remove Office 2010 and check again that I have all the pre-requisites and retry. Please bear with me as I'm currently working on a more urgent task.

    Thanks again.

    Kevan

    Monday, April 23, 2012 7:55 AM