You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dotnet pack fails with Could not evaluate 'Microsoft.CSharp.dll' for extension metadata. Exception message: Could not load file or assembly 'Microsoft.CSharp, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
#4856
I can't pack a project that has a dependency on Microsoft.NET.Sdk.Functions 1.0.29, the exact command and output can be found in the details section below.
I don't get an actual error but the output folder is empty. I also get the same error on dotnet build and `dotnet
I'm getting the following warning C:\Users\jonas\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(52,5): warning : Could not evaluate 'Microsoft.CSharp.dll' for extension metadata. Exception message: Could not load file or assembly 'Microsoft.CSharp, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. and guessing that it is why it doesn't work
.
Seems related to #4055 and as requested by @brettsam I've emailed him the binlog.
dotnet pack --no-restore --no-build -c release -o ./.artifacts --include-symbols -p:SymbolPackageFormat=snupkg C:\dev\GitHub\Handyman\src\Handyman.Azure.Functions\build/../src/Handyman.Azure.Functions.csproj /bl
Microsoft (R) Build Engine version 16.2.32702+c4012a063 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\2.2.401\MSBuild.dll -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\2.2.401\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\2.2.401\dotnet.dll -maxcpucount -property:NoBuild=true -property:Configuration=release -property:PackageOutputPath=./.artifacts -property:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -target:pack -verbosity:m /bl C:\dev\GitHub\Handyman\src\Handyman.Azure.Functions\build/../src/Handyman.Azure.Functions.csproj
Handyman.Azure.Functions -> C:\dev\GitHub\Handyman\src\Handyman.Azure.Functions\src\bin\release\netstandard2.0\publish\
C:\Users\jonas\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(52,5): warning : Could not evaluate 'Microsoft.CSharp.dll' for extension metadata. Exception message: Could not load file or assembly 'Microsoft.CSharp, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. [C:\dev\GitHub\Handyman\src\Handyman.Azure.Functions\src\Handyman.Azure.Functions.csproj]
dotnet --info:
.NET Core SDK (reflecting any global.json): Version: 2.2.401
Commit: 729b316c13
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.401\
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
The text was updated successfully, but these errors were encountered:
That warning isn't related. We try to look for extensions in every assembly in bin, and some platform assemblies can't be evaluated. We log a warning as an FYI, but it's not affecting this.
That's why you're not getting anything. I see that in the binlog here too (looks like there's a warning setting that's also false):
Task "IsPackableFalseWarningTask" skipped, due to false condition; ('$(IsPackable)' == 'false' AND '$(WarnOnPackingNonPackableProject)' == 'true') was evaluated as ('false' == 'false' AND 'false' == 'true').
Instead, you should break out the pieces that you want to be redistributable as nuget packages into their own class library projects and pack them. Then your Functions project can reference that project.
I can't pack a project that has a dependency on Microsoft.NET.Sdk.Functions 1.0.29, the exact command and output can be found in the details section below.
I don't get an actual error but the output folder is empty. I also get the same error on
dotnet build
and `dotnetI'm getting the following warning
C:\Users\jonas\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(52,5): warning : Could not evaluate 'Microsoft.CSharp.dll' for extension metadata. Exception message: Could not load file or assembly 'Microsoft.CSharp, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
and guessing that it is why it doesn't work.
Seems related to #4055 and as requested by @brettsam I've emailed him the binlog.
The code can be found at https://github.com/JonasSamuelsson/Handyman/tree/957ad85ea139cd8e6c37fce69046851cb4388d62/src/Handyman.Azure.Functions
The error occurs both locally and in devops, https://dev.azure.com/jonassamuelsson/Handyman/_build/results?buildId=193&view=results
powershell:
dotnet --info:
The text was updated successfully, but these errors were encountered: