Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Can't access appsettings.json configuring a service

$
0
0

Hello,

I try to access my appSettings using DI.

I try to configure my custom service in "startup.cs".

I seem to have comptaibility problems in project.json. I read some articles about the same problem but can't figure out how to solve my problem?

The error message is : 

Impossible de charger le type 'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions' à partir de l'assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

And here is my project.json :

{"dependencies": {"BundlerMinifier.Core": "2.2.281","EntityFramework":  "6.1.3","MailKit": "1.8.1","Microsoft.ApplicationInsights.AspNetCore":  "1.0.0","Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final","Microsoft.AspNetCore.Diagnostics": "1.0.0","Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0","Microsoft.AspNetCore.Mvc":  "1.0.0","Microsoft.AspNetCore.Razor.Tools": {"version": "1.0.0-preview2-final","type": "build"
    },"Microsoft.AspNetCore.Routing": "1.0.1","Microsoft.AspNetCore.Server.IISIntegration": "1.0.0","Microsoft.AspNetCore.Server.Kestrel": "1.0.1","Microsoft.AspNetCore.Session": "1.0.0","Microsoft.AspNetCore.StaticFiles": "1.0.0","Microsoft.EntityFrameworkCore": "1.0.1","Microsoft.EntityFrameworkCore.SqlServer": "1.0.1","Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1","Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final","Microsoft.Extensions.Caching.Memory": "1.0.0","Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0","Microsoft.Extensions.Configuration.Json": "1.0.0","Microsoft.Extensions.Logging": "1.0.0","Microsoft.Extensions.Logging.Console": "1.0.0","Microsoft.Extensions.Logging.Debug": "1.0.0","Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0","Newtonsoft.Json": "9.0.1"
  },"tools": {"BundlerMinifier.Core": "2.0.238","Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final","Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final","Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
  },"frameworks": {"net461": {"frameworkAssemblies": {"System.Configuration": "4.0.0.0"
      }
    }
  },"buildOptions": {"emitEntryPoint": true,"preserveCompilationContext": true
  },"publishOptions": {"include": ["wwwroot","**/*.cshtml","appsettings.json","web.config"
    ]
  },"scripts": {"prepublish": [ "bower install", "dotnet bundle" ],"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

 


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>