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

Please update Microsoft.Extensions.DependencyModel to the latest version. #83

Closed
niemyjski opened this issue Jan 27, 2018 · 10 comments · Fixed by #100
Closed

Please update Microsoft.Extensions.DependencyModel to the latest version. #83

niemyjski opened this issue Jan 27, 2018 · 10 comments · Fixed by #100

Comments

@niemyjski
Copy link

This might break asp.net core 1.0 but if you are running on 2.0 you have major headaches and runtime errors as well as these warnings if you are using the AspNetCore.All meta package. And you are faced to add <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.3" /> of version >=2.0.3

warning MSB3277: Found conflicts between different versions of "Microsoft.Extensions.DependencyModel" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.

@nblumhardt
Copy link
Member

👍 this sounds like a fair change to make, at this point.

Help appreciated if anyone's able to work through it.

@skomis-mm
Copy link
Contributor

I didn't notice any compatibility at runtime and build issues with netcoreapp2.0 (tested Microsoft.AspNetCore.All 2.0.0 - 2.0.5 and sdks 2.0.0-2.1.4). Nuget resolves Microsoft.Extensions.DependencyModel to 2.0.0 since its closer to the app (it is a direct dependency of SDK) than 1.0.0.

@nblumhardt
Copy link
Member

Any chance you're using an old dotnet SDK version, @niemyjski ? I've found pretty substantial differences in behaviour from 2.0 up to 2.1.4.

@zagros
Copy link

zagros commented Mar 13, 2018

Any update on this?

@nblumhardt
Copy link
Member

@zagros any chance you can help pin this issue down to a particular configuration/SDK version/project setup? How are you reproducing? Thanks!

@zagros
Copy link

zagros commented Mar 14, 2018

This is happening on .NET Framework 4.6.2 for me the nuget package i'm using is 2.6.0

I enabled verbose logs and I then I saw this error

2>  Unified primary reference "Microsoft.Extensions.DependencyModel, Version=2.0.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
2>      Using this version instead of original version "1.0.0.0" in "C:\Work\_the_project\packages\Serilog.Settings.Configuration.2.6.0-dev-00081\lib\net451\Serilog.Settings.Configuration.dll" because AutoUnify is 'true'.

i'm using the serilog in a class libary that I include in my Windows Service Projects, and Web API projects (both parts of the same sln). The Web API project for example is using Microsoft.AspnetCore 2.0.1 at the moment (I upgraded the project from 1.1 to 2.0.1 and this is happening on the first .boot)

@nblumhardt
Copy link
Member

Thanks @zagros - it sounds like perhaps the missing datum was "full .NET Framework". Do you have the <AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects> in your .csproj file? Thanks again 👍

@zagros
Copy link

zagros commented Mar 14, 2018

No that node doesn't exists

By default it's true

Here's the copy of the propertygroup that normally would have that <AutoGenerateBindingRedirects> if it were to be explicitly mentioned

in my case it's not there at all and hence takes the default behaviour

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{0A749D0A-22AF-4976-A82B-86EA60ECE1EE}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MyProject.Extensions.Logging</RootNamespace>
    <AssemblyName>MyProject.Extensions.Logging</AssemblyName>
    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
    <NuGetPackageImportStamp>
    </NuGetPackageImportStamp>
  </PropertyGroup>

I think it's fair to update the version of the dependency library as the very first post in this thread suggests - 1.0 is long come and gone

@nblumhardt
Copy link
Member

I've updated our dev branch to publish a new major version; I don't think there's a lot of harm in making this change, just to keep things simple - is anyone able to PR this?

@MV10
Copy link
Contributor

MV10 commented Apr 4, 2018

Not to hijack the topic, but any chance you'd be willing to update Microsoft.Extensions.Configuration.Abstractions to 2.0 at the same time? I use this settings-provider, and next week I'm going to look at fixing the netsandard MS SQL sink config issue and would prefer to go with MEC 2.0 across the board. (I haven't checked whether other Serilog repos are dependent on MEC.)

Probably low-risk, it has been my experience that upgrading MEC 1.0 references to 2.0 are largely transparent. (The only real issue for the .NET Framework side is that annoying SDK JSON.NET =9.0.1 binding redirect mess... the MEC.Json 2.0 specfies =10.0.1 or maybe >=10.0.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants