Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
96 stars 62 forks source link

Azure Functions Publish does not copy COMReference COM server dependency to publish output folder #544

Open baumatron opened 2 years ago

baumatron commented 2 years ago

I have an Azure Functions app targeting .NET 6 on Windows, which has a project dependency on a .NET 6 class library which in turn depends on a COMReference which is configured as registration-free and set to copy the COM server to the build output folder. I can confirm that the interop library and the COM server are copied to the build output folder.

The problem is that publishing my functions app fails because the COM server dll isn't copied to the publish output folder and so doesn't get deployed. Here's the class library's project file.


<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Platforms>AnyCPU;x64</Platforms>
  </PropertyGroup>

  <ItemGroup>
    <COMReference Include="Dia2Lib.dll">
      <WrapperTool>tlbimp</WrapperTool>
      <VersionMinor>0</VersionMinor>
      <VersionMajor>2</VersionMajor>
      <Guid>106173a0-0173-4e5c-84e7-e915422be997</Guid>
      <Lcid>0</Lcid>
      <Isolated>true</Isolated>
      <Private>true</Private>
      <CopyLocal>True</CopyLocal>
    </COMReference>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Azure.Storage.Blobs" Version="12.8.0" />
    <PackageReference Include="Azure.Storage.Queues" Version="12.6.0" />
    <PackageReference Include="Microsoft.Azure.Kusto.Data" Version="9.0.8" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
    <PackageReference Include="MongoDB.Driver" Version="2.11.6" />
  </ItemGroup>

</Project>