473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Enterprise Instrumentation Framework

Hi, All,

I have an issue really need help on, Thanks in advance!!!

OS: windows xp
..NET framework v1.1
Enterprise Instrumentation Framework installed

I did the following customization in the event schema project:

Modified the CommonEvent class:

1. added property String ContextKey
2. added property MyExtraInfo ExtraInfo

The MyExtraInfo class:

using System;
using System.Collections.Specialized;
using System.Runtime.Serialization ;
using Microsoft.EnterpriseInstrumentation.Schema;

[Serializable]
[InstrumentationType]
public class MyExtraInfo : ISerializable
{
private NameValueCollection data;
public CLCExtraInfo()
{
data = new NameValueCollection();
}
public CLCExtraInfo(SerializationInfo info,StreamingContext context)
{
data = new NameValueCollection();
System.Runtime.Serialization.SerializationInfoEnum erator enumerator
= info.GetEnumerator();
while (enumerator.MoveNext())
{
data.Add(enumerator.Current.Name,
enumerator.Current.Value.ToString());
}
}
public void Add(string keyName, string keyValue)
{
data.Add(keyName, keyValue);
}
void ISerializable.GetObjectData(SerializationInfo info,
StreamingContext context)
{
if (data.Count == 0) return;
foreach (string key in data.AllKeys)
{
info.AddValue(key, data[key]);
}
}
}

When I raise event with ContextKey and ExtraInfo (added bunch of name-value
pairs) set, from the eventlog, I see the ContextKey has been serialized
correctly
but the ExtraInfo which is a type I defined, serialized as

MyExtraInfo ExtraInfo = {}

which means nothing insidem, Could anyone point out what could be the
problem?

Thanks very much!

John
Nov 15 '05 #1
7 2304

Hi John,

I think you should debug into your application to find if GetObjectData was
called.
For more information about how to do runtime serialization in .Net, Jeffrey
Richter's article is a good resource:
http://msdn.microsoft.com/msdnmag/issues/02/04/net/
http://msdn.microsoft.com/msdnmag/issues/02/07/net/
http://msdn.microsoft.com/msdnmag/issues/02/09/net/

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #2
Hi, Jeffrey,

Thanks for your response. I did a test with MyExtraInfo class it the
GetObjectData did get called and it works fine in a test project.
Then I put a EventLog.Write() inside the GetObjectData for the CommonEvent
class that I added a property ExtraInfo as MyExtraInfo, there is no event
log entry was written so could you please tell me what serialize formatter
or method the LogSink use to serialize event schema class to windows Event
Log?

Could we have the source code for LogSink, WMISink and TraceSink as we do
for the Event Schema? then I can figure it out how the event schema gets
serialized.

Thanks again!

John

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:jH**************@cpmsftngxa07.phx.gbl...

Hi John,

I think you should debug into your application to find if GetObjectData was called.
For more information about how to do runtime serialization in .Net, Jeffrey Richter's article is a good resource:
http://msdn.microsoft.com/msdnmag/issues/02/04/net/
http://msdn.microsoft.com/msdnmag/issues/02/07/net/
http://msdn.microsoft.com/msdnmag/issues/02/09/net/

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

Hi John,

Based on my understanding, you have explicitly serialized the MyExtraInfo
class instance, it works fine, but if you tried to serialize CommonEvent
class object which expose MyExtraInfo as a property, the MyExtraInfo field
is not serialized.
I think you should implement ISerializable interface for CommonEvent class,
and in ISerializable.GetObjectData method, add MyExtraInfo field into the
SerializationInfo parameter, then the .Net Framework will invoke your
MyExtraInfo's serialization operation.
In your MyExtraInfo class's implementation, it is strange that 2 overloaded
constructor's name is not MyExtraInfo, but CLCExtraInfo?
Also, what does your MyExtraInfo.Add's usage?

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #4
Hi, Jeffrey,

Thanks for your information. But I think that might not the issue, because I
tested with the following scenerio:

I created another class TestClass marked as [Serializable] that contains a
public property as type MyExtraInfo, and I use Soap|binary formatter to
serialize the TestClass and the MyExtraInfo's GetObjectData did get called
and it works as I expected.

If a class use any type that implement ISerializable would need to implement
ISerializable then that would be a nightmare!

I guess by some reason, the EIF did not use Binaryformatter or SoapFormatter
to serialize the CommonEvent class - Could you please help us to get the
source code of the logsink to figure out why the customized serialization
method is not called.

Thanks very much!

John

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:3r*************@cpmsftngxa07.phx.gbl...

Hi John,

Based on my understanding, you have explicitly serialized the MyExtraInfo
class instance, it works fine, but if you tried to serialize CommonEvent
class object which expose MyExtraInfo as a property, the MyExtraInfo field
is not serialized.
I think you should implement ISerializable interface for CommonEvent class, and in ISerializable.GetObjectData method, add MyExtraInfo field into the
SerializationInfo parameter, then the .Net Framework will invoke your
MyExtraInfo's serialization operation.
In your MyExtraInfo class's implementation, it is strange that 2 overloaded constructor's name is not MyExtraInfo, but CLCExtraInfo?
Also, what does your MyExtraInfo.Add's usage?

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #5

Hi John,

In Jeffrey Richter's article part 3, he teaches us how to serialize a class
which did not implement Serialization:
http://msdn.microsoft.com/msdnmag/issues/02/09/net/
Acutally, he uses ISerializationSurrogate to help serialize the class. For
private field, use Reflection to refer to them.

For source code, if the downloaded EIF install file did not contain souce
code, it means that there is no public source code for it.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #6

Hi John,

I will help you to find if there is any public source code of EIF.
I will reply you ASAP.
Thanks for your understanding,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #7

Hi John,

Sorry for letting you wait for so long time.
I have confirmed that there is no public source code for EIF. For your
problem, does my workaround make sence?
If it still did not resolve your problem, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Qaurk Noble | last post by:
Hello all, I will like to make use of the "Enterprise Instrumentation Framework" (http://go.microsoft.com/fwlink/?LinkId=17072) however I do not have Windows 2003 server nor Visual Studio 2003. ...
1
by: Sean Walker | last post by:
I have installed the Microsoft Enterprise Instrumentation framework and have installed the samples. I have events successfully being logged to the Application Event Log using the Simple...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
3
by: veera sekhar kota | last post by:
hi, im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked...
0
by: Benny Ng | last post by:
Hi,All, When i deploy Enterprise library with my application ,i used XCOPY to deploy it into my test server. But when application runs, shown some error related registry. (But actually I haven't...
1
by: Manoj Nair | last post by:
Hi all, For our application we need to create a wrapper for the instrumentation and logging block of the Enterprise library june 2005 release. Can any one send a link which can help us in this ?...
7
by: rockdale | last post by:
hi, I just downloaded Microsoft Enterprise Library Jan 2006 and try to integrate it into my asp.net application. As i am going to connect to mySQL database, I need to include the source code in my...
3
by: bungle | last post by:
Hi, I have started using MS Enterprise Library for the data access layer and found it great. I have changed to coding on another machine though and didn't think it necessary to a full install of...
0
by: gfe | last post by:
I have to implement instrumentation block of enterprise library to monitor the application.If someone can help me out that will be great.i have no idea how to do this... thanks.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.