Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Enterprise Tools / November 2003

Tip: Looking for answers? Try searching our database.

error CS0104: 'EventSource' is an ambiguous reference

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vincent A - 22 Nov 2003 15:35 GMT
Hello,
I am getting the error mentioned in the subject when I try
to run a sample EIF code.
Is this due to a configuration issue on my machine.
Any suggestions or pointers are helpful

Thanks
===========================================
class MyComponent
{
  // static instance of the event source associated with
the component
  public static EventSource es = new EventSource
("MyComponent");

  // some method
  public void DoSomeStuff()
  {
     // raise an event
     TraceMessageEvent.Raise(es, "hello");
  }
}
Mike Hayton [MS] - 22 Nov 2003 19:08 GMT
It sounds like you have another EventSource type defined in another
namespace.
However at the point below there's using clauses that mean the compiler
cant figure out what EventSource you're talking about.

One solution is to fully qualify the EventSource below.
E.g.
   public static EventSource es = new EventSource("MyComponent");
becomes
   public static Microsoft.EnterpriseInstrumentation.EventSource es = new
Microsoft.EnterpriseInstrumentation.EventSource("MyComponent");

Cheers

Mike

--------------------

| Hello,
| I am getting the error mentioned in the subject when I try
[quoted text clipped - 18 lines]
|    }
| }

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Vincent A - 23 Nov 2003 04:19 GMT
Mike,
Thanks for your support.
You are exaactly right. I have
EnterpriseInstrumentation.Configuration namespace along
with EnterpriseInstrumentaion., which was the me this
error.
Vincent
>-----Original Message-----
>It sounds like you have another EventSource type defined in another
[quoted text clipped - 7 lines]
>becomes
>    public static
Microsoft.EnterpriseInstrumentation.EventSource es = new
>Microsoft.EnterpriseInstrumentation.EventSource
("MyComponent");

>Cheers
>
[quoted text clipped - 24 lines]
>|    }
>| }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.