none
Microsoft.VisualStudio.Tools.Office.targets(167,9): error : Index not found. (Exception from HRESULT: 0x80131124) RRS feed

  • Question

  • I have an outlook addin visual studio project that has been working fine for a while, but suddenly I now have an issue as it will not build and I get the following error:

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

    It seems to be the same issue as this but I am targeting 2016/2013 instead of 2007.

    I had the error previously and the solution was to change the Microsoft.Office.Interop.Outlook reference to CopyLocal true and EmbedInteropTypes false which fixed it for a time, but it has now come back again.

    Please can someone advise on a solution?

    Thanks.

    Tuesday, January 12, 2016 5:13 PM

Answers

  • Update:

    So I have followed this link to strip out the RegisterFormRegions sections and the project now builds, it would be great to know the underlying reason why it fails in the first place as this isn't exactly the best way to resolve the issue.

    • Marked as answer by NAJ Thursday, January 14, 2016 10:21 AM
    Wednesday, January 13, 2016 10:55 AM

All replies

  • Hello Naj,

    Are you able to reproduce the issue with a newly created add-in project? Does it work correctly?

    Did you change the Microsoft.Office.Interop.Outlook reference according to the target version?

    Tuesday, January 12, 2016 10:29 PM
  • Hi Eugene,

    Trying to replicate this on a fresh project would be very difficult, as I say it has been working fine for a while, then it went away and now it is back again so it is not clear what the real issue is, I suspect the error message is a bit misleading.

    The last time the error was coming up after simply adding a get set string property so it's very odd.

    The office references in the project file are set as follows:

      <ItemGroup>
        <Reference Include="Microsoft.Office.Tools.v4.0.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="Microsoft.Office.Tools, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="Microsoft.Office.Tools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="Microsoft.Office.Tools.Outlook, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Private>True</Private>
        </Reference>
        <Reference Include="Microsoft.Office.Tools.Outlook.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Private>True</Private>
        </Reference>
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
          <Private>False</Private>
          <EmbedInteropTypes>true</EmbedInteropTypes>
        </Reference>
        <Reference Include="Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
          <Private>True</Private>
          <EmbedInteropTypes>False</EmbedInteropTypes>
        </Reference>
      </ItemGroup>


    Wednesday, January 13, 2016 9:52 AM
  • Update:

    So I have followed this link to strip out the RegisterFormRegions sections and the project now builds, it would be great to know the underlying reason why it fails in the first place as this isn't exactly the best way to resolve the issue.

    • Marked as answer by NAJ Thursday, January 14, 2016 10:21 AM
    Wednesday, January 13, 2016 10:55 AM
  • Hi NAJ,

    I am glad you could work around this issue with striping out the RegisterFormRegions sections. Since I could not reproduce this issue at my side, I feel sorry I don’t know the underlying reason.

    In addition, I suggest you mark your reply as answer, and then others who run into the same issue could find this workaround easily.

    Best Regards,

    Edward


    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.


    Thursday, January 14, 2016 8:09 AM