By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hi - I'm trying to use "Microsoft.VisualBasic.Logging.FileLogTraceListene r"
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
Jun 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Tom Kearney" wrote:
Hi - I'm trying to use "Microsoft.VisualBasic.Logging.FileLogTraceListene r"
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

Jun 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.