最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Referencing Interop.Redemption in Azure-Devops Pipeline - Stack Overflow

programmeradmin1浏览0评论

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.

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.

Share Improve this question asked Jan 30 at 22:35 KasterKaster 891 silver badge7 bronze badges 2
  • 2 Please include the YAML from your pipeline that shows how you are compiling the solution. Include error messages that you are seeing so that others might be able to answer your question. – bryanbcook Commented Jan 31 at 4:05
  • 1 You can try to publish the dll in custom nuget package and restore it in the pipeline to get the dll. Please refer to the similar ticket for your reference. – wade zhou - MSFT Commented Jan 31 at 9:54
Add a comment  | 

2 Answers 2

Reset to default 1

Instead of referencing Redemption the COM library (which requires it to be installed on the builder machine), add a reference to Interop.Redemption.dll (a signed one is included with Redemption or you can reference the one created by VS on you machine) - this way building Redemption will not require it to be installed at compile-time.

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/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>

发布评论

评论列表(0)

  1. 暂无评论