I wish to use LogParser.DLL
assembly, so I test it over normal console application, it worked, then I put it into a server, send to win 2003 for testing(i have no more free space to install services like database), ...
it always returned FileNotFoundException Error in eventViewer logs...
I tried to use stack trace to see what really happen, and I see the DLL does not import at all, afte some searching at Google I find an answer in this web site, which told to use .Net command prompt, and then use import assembly command, if I'm write it was tblimp "file name" /out "new file"
I made my assembly, it was .net 4 so I went to my older VS, and done same to provide a .net 2.0.x compatible DLL, I use it and it worked, but...
New Error Apeared:
Error Msg: Retrieving the COM class factory for component with CLSID {8CFEBA94-3FC2-45CA-B9A5-9EDACF704F66} failed due to the following error: 80040154. StackTrace: at FileEventReaderService.EventReader.ReadEventsAndStoreInDatabase(String startDate, String endDate)
ILogRecordset rs = null;
try
{
((DebugLogger) _logProviderDebugMode).Log("T1-2", "Debug-EventReaderClass",
EventLogEntryType.Information);
LogQueryClass qry = new LogQueryClass();
COMEventLogInputContextClass eventLogFormat = new COMEventLogInputContextClassClass();
((DebugLogger) _logProviderDebugMode).Log("T1-3", "Debug-EventReaderClass",
EventLogEntryType.Information);
string query = "select * from security WHERE TimeGenerated >= '" + startDate +
"' and TimeGenerated <'" + endDate +
"' and (eventid=560 or eventid=540)";
rs = qry.Execute(query, eventLogFormat);
((DebugLogger) _logProviderDebugMode).Log("T1-4", "Debug-EventReaderClass",
EventLogEntryType.Information);
for (; !rs.atEnd(); rs.moveNext())
{
//Processes
}
}
catch(Exception ex)
{
((DebugLogger)_logProviderDebugMode).Log(
"T1-5\nError Msg: " + ex.Message + "\nStackTrace: " + ex.StackTrace
, "Debug-EventReaderClass",
EventLogEntryType.Error);
}
finally
{
((DebugLogger)_logProviderDebugMode).Log("T1-6", "Debug-EventReaderClass",
EventLogEntryType.Information);
if (rs != null)
rs.close();
}
I tried to catch the exception and see if any data is imported, but it seem rs return nothing, also without the if(rs!=null) in "finally" block again it's it self an error which mean rs is null
Event Type: Information Event Source: EventLoggerService Event Category: None Event ID: 0 Date: 8/5/2012 Time: 2:47:20 AM User: N/A Computer: HF-SERVER-PC Description: Debug-EventReaderClass: T1-2
Class Variable Information:
---------------------------
_logProvider: FileEventReaderService.Services.Logger.EventLogger
_logProviderDebugMode: FileEventReaderService.Services.Logger.DebugLogger
_licenceState: OK
_dataBase: deadManN
_interval: 5
_timeGap: 1
_previousReadTime: 8/5/2012 2:40:19 AM
_lastReadTime: 8/5/2012 2:46:20 AM
_parserLock: System.Object
_subtleTime: TimerLib.SubtleTime
_parserService: FileEventReaderService.Services.Util.ParserService5
_connectionStringBuilder: FileEventReaderService.Services.Util.ConnectionStringBuilder
_lastTime: 18
_minutes: 18
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
the above log, is last log I did before the error, and then it show the log which is logged in "catch" block, so error can be here:
LogQueryClass qry = new LogQueryClass();
COMEventLogInputContextClass eventLogFormat = new COMEventLogInputContextClassClass();
so I again start searching for my error msg, and found some things which I was not able to handle alone,
for example, I see some one said to you need to register the DLL manually or using dllregisterservice or things about putting application to be compile only for 86X CPU type, but I don't wanna do this... cause I don't write this for single user with known hardware and software...
How do I deal with the DLL registering while setup application or any thing else which may help about the matter? of Interop.MSUtil.dll
library?
It's so important for me, and still there's too much of time I need, about months after this to just check for logical bugs, not compile ones