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

Microsoft.Extensions.Logging.Abstractions missing #902

Closed
basqueinnz opened this issue Mar 19, 2018 · 5 comments
Closed

Microsoft.Extensions.Logging.Abstractions missing #902

basqueinnz opened this issue Mar 19, 2018 · 5 comments
Assignees
Labels
bug This issue is a bug. Extensions

Comments

@basqueinnz
Copy link

basqueinnz commented Mar 19, 2018

Hi,
Using dotnet core 2.0, while writing some tests that reference a project with a nuget dependency to:
AWSSDK.Extensions.NETCore.Setup (3.3.4),
I get the error that the Microsoft.Extensions.Logging.Abstractions v1.0 assembly cannot be found (callstack further below).

I had a quick look to your code and in my opinion (could be wrong), it might be missing a line in the nuspec (the last dependency line):

<dependencies>
      <group targetFramework="netstandard1.3">
        <dependency id="AWSSDK.Core" version="[3.3.13.3, 3.4)" />
        <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="1.0.2" />
        <dependency id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.0.2" />
        <dependency id="Microsoft.Extensions.Logging.Abstractions" version="1.0.0" />
      </group>
    </dependencies>

After adding this line, recreating the package manually, overwriting the existing version and rebuilding the project, my code simply works.
Important: it also works if I just add manually the logging package with a v1.0 to my project, without modifying aws-sdk-net at all.
Important2: it also works if I downgrade to:
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.1" />
instead of 3.3.4 that is the current one.

Expected Behavior

I should not get an error describing a missing assembly when running a project test.

Possible solution above.

Current Behavior

System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
at Amazon.Extensions.NETCore.Setup.ClientFactory.CreateServiceClient(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)

Possible Solution

Possible solution above.

Steps to Reproduce (for bugs)

Context

Developing a lambda that makes use of SQS and while writing some tests I got this issue.

Your Environment

  • AWSSDK.Core version used:
    AWSSDK.Extensions.NETCore.Setup (3.3.4)

  • Service assembly and version used:
    AWSSDK.Extensions.NETCore.Setup (3.3.4)

  • Operating System and version:
    Windows 10

  • Visual Studio version:
    VS 2017

  • Targeted .NET platform:
    ASP.NET Core 2.0

.NET Core Info

  • .NET Core version used for development:
  • .NET Core version installed in the environment where application runs:
  • Output of dotnet --info:
    .NET Command Line Tools (2.1.4)

Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190

Runtime Environment:
OS Name: Windows
OS Version: 10.0.15063
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.4\

Microsoft .NET Core Shared Framework Host

Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54

  • Contents of project.json/project.csproj:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
  </PropertyGroup>

  <ItemGroup>
    <None Remove="appSettings.json" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.1.0" />
    <PackageReference Include="Amazon.Lambda.KinesisEvents" Version="1.0.1" />
      <PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.4" />
      <PackageReference Include="AWSSDK.SQS" Version="3.3.3.4" />
      <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.1" />
      <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.1" />
      <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
      <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.1" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.1.1" />
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Include="appSettings.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Bankrekt.Scheduler.Shared\Bankrekt.Scheduler.Shared.csproj" />
  </ItemGroup>

</Project>
@sstevenkang
Copy link
Contributor

This is probably because your project is targeting 2.0 and is pulling 2.0 of Microsoft.Extensions.Logging.Abstractions, but NETCore.Setup is looking for 1.0 binaries. We'll take a look at this.

@normj
Copy link
Member

normj commented Mar 29, 2018

Good catch about the missing reference. I'm making that change and will get an update out soon.

@normj
Copy link
Member

normj commented Mar 29, 2018

Version 3.3.3.5 was released thanks for letting us know about the issue.

@normj normj closed this as completed Mar 29, 2018
@madhu-sameena
Copy link

madhu-sameena commented Oct 7, 2019

I am seeing similar kind of issue with dotnet core 3.0 Any clue about it?

@RobBowman
Copy link

I also get the same problem when building for dotnet core 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. Extensions
Projects
None yet
Development

No branches or pull requests

6 participants