Azure / Azure/azure-functions-host

Referencing Microsoft.Extensions.Logging

Open
#1,570 19 comments 0 reactions 1 assignee Claimed by @brettsam View on GitHub
needs-investigation
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

We have been using Microsoft.Extensions.Logging in our Azure Functions since August 2016
by copying the DLLs to a shared \bin folder and referencing from the function.

Release 1.0.1.10917 on April 28 was a breaking change for our apps that use Logging because the logging extensions DLLs were added to the site extensions directory in that release had different versions than we deployed to the Functions \bin directory.

#### Repro steps

1. Deploy Microsoft.Extensions.Logging to Function App \bin folder

2. Reference the DLLs in the function:

#r "..\bin\Microsoft.Extensions.Logging.Abstractions.dll"
#r "..\bin\Microsoft.Extensions.Logging.dll"

#### Expected behavior

Should be able to create an instance of ILogger

#### Actual behavior

error CS0266: Cannot implicitly convert type 'Microsoft.Extensions.Logging.ILogger [D:\home\site\wwwroot\bin\Microsoft.Extensions.Logging.Abstractions.dll]' to 'Microsoft.Extensions.Logging.ILogger [D:\Program Files (x86)\SiteExtensions\Functions\1.0.11002\bin\Microsoft.Extensions.Logging.Abstractions.dll]'. An explicit conversion exists (are you missing a cast?)

Is referencing the logging extensions now available via #r "Microsoft.Extensions.Logging" now that they are deployed to site extensions bin folder?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.