Using Microsoft.VisualBasic.Logging from a C# .Net 2.0 aspx page?

  • Thread starter Thread starter Tom Kearney
  • Start date Start date
T

Tom Kearney

Hi - I'm trying to use "Microsoft.VisualBasic.Logging.FileLogTraceListener"
from a set of C# aspx web pages, but I can't seem to use:

<%@ Import Namespace="Microsoft.VisualBasic.Logging" %>

I get a compilation error (Compiler Error Message: CS0234: The type or
namespace name 'Logging' does not exist in the namespace
'Microsoft.VisualBasic' (are you missing an assembly reference?)).

I can import the "Microsoft.VisualBasic" namespace OK, but that doesn't help
with using FileLogTraceListener.

I think this must be something simple I'm missing.... any ideas?

Thanks,
Tom Kearney
 
It looks like you are using "script only" ASPX pages. In a regular
codebehind model, you would set a reference in the solution explorer
"References" section to the Microsoft.VisualBasic assembly. Then, you would
use the
using Microsoft.VisualBasic.Logging; directive at the top of your codebehind
class.

Finally,

protected void Page_Load(object sender, EventArgs e)
{
Microsoft.VisualBasic.Logging.FileLogTraceListener fltl = new
FileLogTraceListener();

Hope that helps.
Peter
 
Back
Top