I get following exception:
``` C#
Additional information: Method 'get_Sources' in type 'Microsoft.Extensions.Configuration.ConfigurationBuilder' from assembly 'Microsoft.Extensions.Configuration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
at Microsoft.AspNetCore.Hosting.WebHostBuilder..ctor()
at Test.Web.Program.Main(String[] args) in C:\GIT\Test\Test.Websrc\Test.Web\Program.cs:line 14
on Program/Main
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup
.Build();
host.Run();
```
Any way to get more info on what is causing this?
Those kind of exceptions happen when you botch the update. You're likely using new and old packages at the same time.
Is there any way to get more information as
Additional information: Method 'get_Sources' in type 'Microsoft.Extensions.Configuration.ConfigurationBuilder is too general. No stacktrace at all!!
The stack trace is right there:
at Microsoft.AspNetCore.Hosting.WebHostBuilder..ctor()
at Betslip.Web.Program.Main(String[] args) in C:\GIT\Test\Test.Web\src\Test.Web\Program.cs:line 14
It just happens to be extremely short. You have a dependency issue. Paste your project.json here and I'm sure we'll see some bad references in there.
{
"dependencies": {
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview1-final",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0-rc2-final",
"AutoMapper": "4.2.1"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"net46": {
"dependencies": {
"Test.DAL": {
"target": "project"
},
"Test.DTO": {
"target": "project"
},
"Test.Service.DAL": {
"target": "project"
}
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Now we need your project.lock.json file
Please take it from here
Everything looks good. Can you reproduce the issue on a new application? Do you have old binaries hanging around in the bin folder? Did you try cleaning?
I tried cleaning but still the same problem. On a new application I cannot reproduce it. anyway I will find a workaround but more verbose exception would be highly desired.
but more verbose exception would be highly desired.
It's a .NET exception and the stack trace is correct, I'm not sure what else it would say.
I'm going to close this issue, reopen it if you have any more insights or figure things out.
In case anyone finds this issue via Google as I did, here's how I was able to resolve the problem:
No amount of cleaning, removing the bin folders, purging the packages folder, or adding the correct version in project.json worked for me. I had to run the "Update-Package Microsoft.Extensions.Configuration -Pre" command from the Package Manager Console. Note that updating from the Nuget Package Manager GUI didn't work; it had to be the command line for me.
I noticed that Visual Studio was still grabbing the RC1 package from nuget no matter how project.json was configured.
Just like pantonis, it was only an issue for existing projects for me. New RC2 projects were fine.
Most helpful comment
Those kind of exceptions happen when you botch the update. You're likely using new and old packages at the same time.