VS2010 building Outlook 2007 Addin - RegisterFormRegions msbuild fails RRS feed

  • Question

  • I am trying to build this Outlook2007 addin but keep getting the below error (from MSBuild log).  It started happening after I added additional controls (textboxes and labels) to an existing form and tried to build again.  If I delete the newly added controls, it builds fine.  Add them back and the error occurs.  So frustrating.  Any ideas would be greatly appreciated!

    Task "RegisterFormRegions" (TaskId:26)

    C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(167,9): error : Index not found. (Exception from HRESULT: 0x80131124)

    Done executing task "RegisterFormRegions" -- FAILED. (TaskId:26)

    Done building target "VisualStudioForApplicationsBuild" in project "Networx Order Tool.vbproj" -- FAILED.: (TargetId:52)

    Target "_CheckForCompileOutputs" skipped. Previously built successfully.

    Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Off' == 'On' or (''!='' and 'Off' == 'Auto')).

    Target "_CleanGetCurrentAndPriorFileWrites: (TargetId:53)" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets" from project "C:\Documents and Settings\mh6906\My Documents\Visual Studio 2010\Projects\Networx Order Tool\Networx Order Tool\Networx Order Tool.vbproj" (target "_CleanRecordFileWrites" depends on it):

    Task "ReadLinesFromFile" (TaskId:27)

    Friday, December 16, 2011 8:16 PM

All replies

  • Hello,

    Check that you build everything to the same platform. Since Outlook 2007 is 32-bit, you need to use either x86 or AnyCPU (preferred).

    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader
    Friday, December 16, 2011 10:14 PM
  • Andrei,

    Thanks so much for the reply.  This project has always been set to build for AnyCPU.  I've added some additional details in reply to my original post.


    Saturday, December 17, 2011 8:06 PM
  • Here is some additional information....

    Although this is an Outlook Addin, I am not using any Outlook Forms as part of this project.  This addin adds buttons to the commandbar and uses Windows Forms only for user interaction.  I learned that the failing task, "RegisterFormRegions" is related to Outlook Form Regions which my project is not using.

    As a workaround, I created a customer MSbuild .targets file to exclude the task of "RegisterFormRegions" and editted my project's .vbproj file to use the customer .targets file.  My project now builds correctly every time.

    Although this workaround avoids the original problem, it doesn't fix it.  I would still like to understand why adding additional controls on a Windows Form causes the MSBuild task of "RegisterFormRegions" (which is related to Outlook Forms and not Windows Forms) to fail.  Any ideas?

    Saturday, December 17, 2011 8:18 PM