Azure/azure-functions-dotnet-extensions

Microsoft.NET.Sdk.Functions > 3.0.3 publish skips lots of DLLs

HansOlavS opened this issue · 3 comments

I just upgraded my Visual Studio Azure Function project to use Microsoft.NET.Sdk.Functions 3.0.6. It seems that DLL dependencies aren't copied to the output folder on publish.

Here's the dependency list when publishing with 3.0.3:
ExcelDataReader.DataSet.dll ExcelDataReader.dll Isopoh.Cryptography.Argon2.dll Isopoh.Cryptography.Blake2b.dll Isopoh.Cryptography.SecureArray.dll Microsoft.ApplicationInsights.dll Microsoft.AspNetCore.Authentication.Abstractions.dll Microsoft.AspNetCore.Authentication.Core.dll Microsoft.AspNetCore.Authorization.dll Microsoft.AspNetCore.Authorization.Policy.dll Microsoft.AspNetCore.Connections.Abstractions.dll Microsoft.AspNetCore.Hosting.Abstractions.dll Microsoft.AspNetCore.Hosting.Server.Abstractions.dll Microsoft.AspNetCore.Http.Abstractions.dll Microsoft.AspNetCore.Http.Connections.Client.dll Microsoft.AspNetCore.Http.Connections.Common.dll Microsoft.AspNetCore.Http.dll Microsoft.AspNetCore.Http.Extensions.dll Microsoft.AspNetCore.Http.Features.dll Microsoft.AspNetCore.JsonPatch.dll Microsoft.AspNetCore.Mvc.Abstractions.dll Microsoft.AspNetCore.Mvc.Core.dll Microsoft.AspNetCore.Mvc.Formatters.Json.dll Microsoft.AspNetCore.Mvc.WebApiCompatShim.dll Microsoft.AspNetCore.ResponseCaching.Abstractions.dll Microsoft.AspNetCore.Routing.Abstractions.dll Microsoft.AspNetCore.Routing.dll Microsoft.AspNetCore.SignalR.Client.Core.dll Microsoft.AspNetCore.SignalR.Client.dll Microsoft.AspNetCore.SignalR.Common.dll Microsoft.AspNetCore.SignalR.Protocols.Json.dll Microsoft.AspNetCore.WebUtilities.dll Microsoft.Azure.WebJobs.dll Microsoft.Azure.WebJobs.Extensions.dll Microsoft.Azure.WebJobs.Extensions.Http.dll Microsoft.Azure.WebJobs.Extensions.Storage.dll Microsoft.Azure.WebJobs.Host.dll Microsoft.Azure.WebJobs.Host.Storage.dll Microsoft.Build.Framework.dll Microsoft.Build.Utilities.Core.dll Microsoft.DotNet.PlatformAbstractions.dll Microsoft.Extensions.Caching.Abstractions.dll Microsoft.Extensions.Caching.Memory.dll Microsoft.Extensions.Configuration.Abstractions.dll Microsoft.Extensions.Configuration.Binder.dll Microsoft.Extensions.Configuration.dll Microsoft.Extensions.Configuration.EnvironmentVariables.dll Microsoft.Extensions.Configuration.FileExtensions.dll Microsoft.Extensions.Configuration.Json.dll Microsoft.Extensions.DependencyInjection.Abstractions.dll Microsoft.Extensions.DependencyInjection.dll Microsoft.Extensions.DependencyModel.dll Microsoft.Extensions.FileProviders.Abstractions.dll Microsoft.Extensions.FileProviders.Physical.dll Microsoft.Extensions.FileSystemGlobbing.dll Microsoft.Extensions.Hosting.Abstractions.dll Microsoft.Extensions.Hosting.dll Microsoft.Extensions.Logging.Abstractions.dll Microsoft.Extensions.Logging.Configuration.dll Microsoft.Extensions.Logging.dll Microsoft.Extensions.ObjectPool.dll Microsoft.Extensions.Options.ConfigurationExtensions.dll Microsoft.Extensions.Options.dll Microsoft.Extensions.Primitives.dll Microsoft.IdentityModel.JsonWebTokens.dll Microsoft.IdentityModel.Logging.dll Microsoft.IdentityModel.Tokens.dll Microsoft.Net.Http.Headers.dll Microsoft.Win32.SystemEvents.dll Microsoft.WindowsAzure.Storage.dll NCrontab.Signed.dll Newtonsoft.Json.Bson.dll Newtonsoft.Json.dll StrexGateway.dll System.Configuration.ConfigurationManager.dll System.Data.SqlClient.dll System.Drawing.Common.dll System.IdentityModel.Tokens.Jwt.dll System.IO.Pipelines.dll System.Net.Http.Formatting.dll System.Security.Cryptography.Pkcs.dll System.Security.Cryptography.ProtectedData.dll System.Security.Cryptography.Xml.dll System.Security.Permissions.dll System.Windows.Extensions.dll
Here's the same list publishing with 3.0.6:
ExcelDataReader.DataSet.dll ExcelDataReader.dll Isopoh.Cryptography.Argon2.dll Isopoh.Cryptography.Blake2b.dll Isopoh.Cryptography.SecureArray.dll Microsoft.ApplicationInsights.dll Microsoft.AspNetCore.Http.Connections.Client.dll Microsoft.AspNetCore.SignalR.Client.Core.dll Microsoft.AspNetCore.SignalR.Client.dll Microsoft.Azure.WebJobs.Extensions.Storage.dll Microsoft.Build.Utilities.Core.dll Microsoft.IdentityModel.JsonWebTokens.dll Microsoft.Win32.SystemEvents.dll Microsoft.WindowsAzure.Storage.dll NCrontab.Signed.dll System.Data.SqlClient.dll System.Drawing.Common.dll System.Windows.Extensions.dll

This is by design. This provides a runtime and deployment optimization excluding platform specific assemblies. If you're running into a problem because of this behavior, can you please open a separate issue with those details? Thanks!

@fabiocav When I deploy to Azure it's not able to run because it's missing DLLs like Newtonsoft.Json.dll. That's not part of the platform specific assemblies, no?

@fabiocav Here's the actual problem I'm facing:
Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

This assembly is used by a service-layer project my app function is referencing and when I try to publish with a newer version of Microsoft.NET.Sdk.Functions than 3.0.3 this assembly (and probably others as well) are missing and then I get runtime errors.