views:

970

answers:

5

This has got to be a lamer question:

In my test project I am attempting to configure log4net. The following method call gives the error.

BasicConfigurator.Configure();

"type name expected but method found"

What am I overlooking?

Thanks, Nick

A: 

Is this a compile time error or runtime error? Do you have a using log4net.Config statement in your class file? Does it still happen if you change it to reference the full class name?

log4net.Config.BasicConfigurator.Configure();
tvanfosson
A: 

Yes.. I have this referenced. I tried the fully qualified name. I don't get it. I can see the method in the namespace. Perhaps this is a version issue.

-Nick

Nick
A: 

I'm not sure if linking to blog entries is verboten...

If you are trying to log NHibernate stuff, here is what I do:

How to show Log4Net info in NUnit (from NHibernate)

I also have a more basic getting started guide here:

Getting Started with Log4Net

Chris Brandsma
btw: Hi nick. :)
Chris Brandsma
A: 

Chris,

It's your article that I used. Look at your test project. You are making a call to a method called "Configure". This is the issue. I think I will try a new library just for kicks.

Nick
A: 

oops.. I was trying to do this in the wrong context. I added the method call to my test project's constructor and we're good.

Nick