-
Notifications
You must be signed in to change notification settings - Fork 203
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
Possible Issues with Common.Logging / Common.Logging.NLog20 NuGet packages #23
Comments
I created a new MVC 4 Razer web application, added the Common.logging.NLog20 package (which installed the Common.Logging dependency) and did not have this problem. I then added the folllowing to the configSections in web.config: and added a nlog section with some arbitrary config: and I still couldn't reproduce what you've described. Is there any more detail you can provide? |
Hi Peter, Here's some more detailed STR what I'm seeing... I seem to be getting a slightly different error message when I use a simpler logger configuration, but the 'fix' is the same.
Failed obtaining configuration for Common.Logging from configuration section 'common/logging'.
|
The same error happened to me. Steps to reproduce:
public class HomeController : Controller
{
private ILog log = LogManager.GetCurrentClassLogger();
public ActionResult Index()
(...)
See also: http://stackoverflow.com/questions/14840445/how-can-i-successfully-configure-common-logging |
The problem is in a NuGet package spec you have dependencies [dependency id="Common.Logging" version="2.0.0" ] |
To me the fix is in the nuget package as well, but why it doesnt include the NET4 assembly? It seems only to include NET2.0. UPDATE: I confirm skalinkin solution is the fix. |
Anything happening with this? Its quite annoying |
@skalinkin is right, updating Common.Logging to v2.1.2 will fix this. It's annoying, but once you pull down the correct package and set auto-restore ... you won't have to think about it. |
do we select this for log or landing spaceship to mars? please fix issues and left clarified sample. what a nice standart! common.logging! blah blah blah |
Closed as fixed with update to Common.Logging 2.1.2 |
I think there may be an error in the information added to web.config when the indicated NuGet packages are added to a project.
When the package is added to the project, the following is added to web.config:
Unfortunately this seems to result in the following error at run-time :
Parser Error Message: An error occurred creating the configuration section handler for common/logging: Unable to create type 'Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20'
I had to make the following change in order to resolve the issue (note the 'oldVersion' attribute)...
The text was updated successfully, but these errors were encountered: