Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.NET.Sdk.Functions >3.0.3 can't find dependency DLLs #465

Closed
josh-endries opened this issue Aug 31, 2020 · 5 comments
Closed

Microsoft.NET.Sdk.Functions >3.0.3 can't find dependency DLLs #465

josh-endries opened this issue Aug 31, 2020 · 5 comments
Assignees

Comments

@josh-endries
Copy link

If I have a v3 Function using netcoreapp3.1 that references a netstandard2.1 project, and that project includes a dependency. The Function can't load at least one of those dependency assemblies. For example, the Function project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    <Version>1.0</Version>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.9" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyDependency.csproj" />
  </ItemGroup>
</Project>

The dependency project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.Interactive.Async" Version="4.1.1" />
  </ItemGroup>
</Project>

The error:

[8/31/2020 7:56:46 PM] System.Private.CoreLib: Exception while executing function: Foo. MyProject: Could not load file or assembly 'System.Interactive.Async, Version=4.1.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. The system cannot find the file specified.

Adding the problem package directly into my Function app didn't help, but changing the SDK package back to 3.0.3 works. It seems to stop working with 3.0.4.

One thing to note is that the error references 4.1.0.0 but the package and DLL itself (in file explorer property details) both seem to be 4.1.1, so it might be something with this package specifically... I did try to use 4.0.0 of that package in both projects and still had the same issue (it couldn't find the v4.0.0.0 DLL). I think in all cases, or all the ones I checked at least, the DLL was actually in the bin folder.

I suspect this is the same issue as Azure/azure-functions-dotnet-extensions#41

@giuliov
Copy link

giuliov commented Sep 12, 2020

I noticed a similar issue after updating from 3.0.2 to 3.0.9: about 80 dependent DLLs disappeared from the publish output, I had to rollback.

giuliov added a commit to tfsaggregator/aggregator-cli that referenced this issue Sep 13, 2020
Stick to `Microsoft.NET.Sdk.Functions` 3.0.3 until they resolve [#465](Azure/azure-functions-vs-build-sdk#465). This locks `Microsoft.Extensions.Logging` to 3.1.6 too.
@giuliov
Copy link

giuliov commented Nov 1, 2020

This is a serious issue for Aggregator, can someone take a look at this issue and give some feedback?

@briangardner
Copy link

We're seeing this same issue with the Microsoft.Extensions.Caching.* libraries.

@haintechdev
Copy link

I have the same issue with version 3.0.11 of the Microsoft.NET.Sdk.Functions package i try and the error began in version 3.0.9, older version work fine.

@zhaparoff
Copy link

Please refer to Azure/azure-functions-host#5894 for the root cause and the available workarounds.
But, primarily, adding

<PropertyGroup>
    <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>

to the project file is the best solution for now and should help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants