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


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
 
Ad

Advertisements

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top