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

Update Microsoft.Extensions.DependencyModel to v3 #222

Merged
merged 1 commit into from
May 13, 2020

Conversation

skomis-mm
Copy link
Contributor

  • fixes #197 to some extent for netstandard2.0 target: the new package uses System.Text.Json instead of Newtonsoft.Json to parse .deps.json files.
  • no need to use workaround from #218 since the new package doesn't bring .NET Core 1.x transitive dependencies, as 2.0.4 of Microsoft.Extensions.DependencyModel does.

Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Ted-chiptech
Copy link

Start to have this error message in Azure Function V3:

Could not load file or assembly 'Microsoft.Extensions.DependencyModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

@nblumhardt
Copy link
Member

Hi @Ted-chiptech - thanks for the heads-up. Can you please let us know which versions you're dealing with (packages, TFMs and runtime), along with a stack trace, in a new issue? May be a regression, but we'll need more info to pin it down. Thanks!

@Ted-chiptech
Copy link

Hi @Ted-chiptech - thanks for the heads-up. Can you please let us know which versions you're dealing with (packages, TFMs and runtime), along with a stack trace, in a new issue? May be a regression, but we'll need more info to pin it down. Thanks!

Hi @nblumhardt, I was using Serilog.Settings.Configuration V3.2.0, The Azure Function runtime is V3, TargetFramework is netcoreapp3.1. then I will get the error above. (The error will show up immediately when starting the project)

However, if I roll back the Serilog.Settings.Configuration package to V3.1.0, everything works fine. Since the error is about 'Microsoft.Extensions.DependencyModel', I think it probably has something to do with this PR. Thanks!

@skomis-mm
Copy link
Contributor Author

Just checked, the Azure Functions host tied to v2.1.0 of Microsoft.Extensions.DependencyModel and the new version of Serilog.Settings.Configuration brings 3.0.0 to the function's *.deps.json which affects the host. 😕

Not sure yet what is the best way to handle this other than to revert this change..

@nblumhardt
Copy link
Member

Nasty... Since Azure Functions will no doubt be updated someday, another option is to continue supporting it via 3.1.0, for now ....

@skomis-mm
Copy link
Contributor Author

skomis-mm commented Aug 17, 2021

@Ted-chiptech , @nblumhardt the source issue.
To summarize, there are a couple of options:

  1. downgrade Microsoft.NET.Sdk.Functions to version 3.0.3 or
  2. add undocument build property to .csproj
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
  1. see if you can migrate to out-of-process executable

@thyde1
Copy link

thyde1 commented Sep 15, 2021

@Ted-chiptech , @nblumhardt the source issue.
To summarize, there are a couple of options:

  1. downgrade Microsoft.NET.Sdk.Functions to version 3.0.3 or
  2. add undocument build property to .csproj
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
  1. see if you can migrate to out-of-process executable

Alternatively you could include

<ItemGroup>
    <FunctionsPreservedDependencies Include="Microsoft.Extensions.DependencyModel.dll" />
</ItemGroup>

in your functions .csproj to preserve only this dependency, and not all, as using _FunctionsSkipCleanOutput would achieve.

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

Successfully merging this pull request may close these issues.

Serilog.Settings.Configuration 3.1.0 transitivly brings Newtonsoft.Json 9.0.1
4 participants