azure-devopsazure-pipelinesoutlook-redemption

Referencing Interop.Redemption in Azure-Devops Pipeline


What are my options for referencing Interop.Redemption.dll at compile time in the DevOps pipeline? I'm repeatedly running into build errors saying that the 'using Redemption;' reference cannot be found.

I've tried storing the DLLs in the repository and referencing them, and I've also tried installing Office on the DevOps agent machine. Now I'm running out of ideas, and DevOps refuses to compile my solution. Everything works perfectly on my local machine.


Solution

  • I have now included and referenced all the necessary libraries as DLLs. The conclusion is that no library may be COM-referenced because DevOps then does not recognize it. On the other hand, there were issues and side effects with different Outlook PIAs, so it took time to understand the differences and versions and to identify the appropriate one for my target system (Outlook 2016).

    I have now included and referenced the 'Interop.Microsoft.Office.Interop.Outlook.dll' v9.6.0.0 and 'Interop.Redemption.dll' v6.6.0.0 as DLLs in Visual Studio. I have also included the 'Redemption64.dll' v6.6 (www.dimastr.com/redemption) as a DLL, but I load it dynamically at runtime. Only in this way does the DevOps pipeline manage to compile everything properly.

    (see screenshot and csproj snippet)

      <ItemGroup>
        <Content Include="lib\Interop.Microsoft.Office.Interop.Outlook.dll" />
        <Content Include="lib\Interop.Redemption.dll">
          <CopyToOutputDirectory>Never</CopyToOutputDirectory>
        </Content>
        <Content Include="lib\Redemption64.dll">
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </Content>
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Interop.Redemption">
          <HintPath>lib\Interop.Redemption.dll</HintPath>
        </Reference>
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Interop.Microsoft.Office.Interop.Outlook">
          <HintPath>lib\Interop.Microsoft.Office.Interop.Outlook.dll</HintPath>
          <Private>True</Private>
          <EmbedInteropTypes>True</EmbedInteropTypes>
        </Reference>
      </ItemGroup>

    enter image description here