Azure / Azure/azure-functions-host
Functions should be able to run separate version of a host dependency
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
#### What problem would the feature you're requesting solve?
If the host has a dependency, you cannot currently use a different version of the dependency in a function. Newtonsoft.Json is an example. The current host uses 11 and there is no good way to use 12.
#### Describe the solution you'd like
If I explicitly define a dependency on a specific version of a module used by the host, my function should get the version I requested instead of the host's version.
#### Describe alternatives you've considered
The alternatives seem to be using the same version of the module as the host, or a different module entirely. I don't think either are great options.
#4049 suggests adding support for Newtonsoft.Json 12 in the host, but seems like a bandaid and would have to be reapplied each upgrade of conflicting dependencies.
#### Additional context
I am running into issues trying to use newtonsoft 12.0.2. The runtime is loading 11, even when i explicitly pull 12 into my az functions 2.0 project. I am encountering an exception running JsonConvert.SerializeObject (which is fixed in v12.0.1) and can see the exception.TargetSite.Module is using 11.
I can see both are loaded, but runtime version is being used for this invocation of JsonConvert.
'func.exe' (CoreCLR: clrhost): Loaded '...\AppData\Local\AzureFunctionsTools\Releases\2.22.0\cli\Newtonsoft.Json.dll'.
'dotnet.exe' (CoreCLR: clrhost): Loaded '...\.nuget\packages\newtonsoft.json\12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll'.
Contributor guide
Research direction
Reproduce the issue in an Azure Functions 2.0 project using Newtonsoft.Json 12.0.2 while the host loads version 11, then inspect the assemblies loaded during a function invocation. Done means an explicitly requested dependency version is used by the function without replacing the host's version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100