Greetings all - I need help, and have exhausted all known resources...
I'm trying to code Logparser-generated reports into a Sharepoint Web Part, but I'm getting error messages from the web server as soon as I try to instantiate a LogQuery object.
Here are snippets of the relevant code (all copied / pasted verbatum from Logparser CHM file):
//================================================v
...
// here are the relevant "using" directives...
using LogQuery = MSUtil.LogQueryClassClass;
using EventLogInputFormat = MSUtil.COMEventLogInputContextClassClass;
using LogRecordSet = MSUtil.ILogRecordset;
...
// here's the code attempting to instantiate a LogQuery object...
// Instantiate the LogQuery object...
LogQuery oLogQuery = new LogQuery(); <------ this is the line that causes error !!! 
...
//================================================^
Here's what I know:
1. My environment is a standalone VPC running BOTH Sharepoint2003, VS.NET2003 and Logparser.
2. I HAVE installed (and used) Logparser.exe on The Sharepoint Server
3. I HAVE manually registered logparser.dll on the server using C:\regsvr32 logparser.dll, and confirmed the operation was successful (got the pop-up alert confirming success)
4. The project DOES build successfully -both the assembly and the CAB file for deployment.
5. I deploy the web part using "STSADM.exe" -o addwppack -filename "C:\GGPDevelopment\GGPWebParts\CCUsageReportCAB\Debug\CCUsageReportCAB.CAB" -force "
[note - This should (and does) deploy the web part assembly (CCUsageReport.dll) to the c:\inetpub\wwwroot\bin\ccusagereport.dll as expected and desired - NOT the GAC... ]
6. I have trust = WSS_Medium set in my c:\inetpub\wwwroot\config\web.config file.
7. I SUCCESSFULLY build the project (solution with web part project and related CAB file).
8. I SUCCESSFULLY deploy the CAB file (get success message from STSADM.exe).BUT...
When I drag & drop the web part from the web part gallery onto a page...
I get the following error message:
Server Error in '/' Application.
File or assembly name Interop.MSUtil, or one of its dependencies, was not found.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: File or assembly name Interop.MSUtil, or one of its dependencies, was not found.The Stack Trace is as follows:
Stack Trace:
[FileNotFoundException: File or assembly name Interop.MSUtil, or one of its dependencies, was not found.] CCUsageReport.CCUsageReport.RenderWebPart(HtmlTextWriter output) +0 Microsoft.SharePoint.WebPartPages.WebPart.b(HtmlTextWriter A_0) Microsoft.SharePoint.WebPartPages.WebPart.o(HtmlTextWriter A_0) Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter writer) System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 Microsoft.SharePoint.WebPartPages.WebPartZone.a(HtmlTextWriter A_0, Boolean A_1, WebPart A_2) Microsoft.SharePoint.WebPartPages.WebPartZone.a(HtmlTextWriter A_0, ArrayList A_1) Microsoft.SharePoint.WebPartPages.WebPartZone.Render(HtmlTextWriter output) System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +44 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +262 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 ASP.default_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in default.aspx:15 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27 Microsoft.SharePoint.Portal.WebControls.WebPartPage.RenderChildren(HtmlTextWriter writer) System.Web.UI.Control.Render(HtmlTextWriter writer) +7 Microsoft.SharePoint.Portal.WebControls.WebPartPage.Render(HtmlTextWriter writer) System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 System.Web.UI.Page.ProcessRequestMain() +1926 |
Lastly, here is a screenshot of my environment, showing NO problems with adding the MSUtils reference to my project:

WITH ALL OF THIS KNOWN, can anyone tell me why I'm getting an error message that Interop.MSUtil or one of its dependencies is NOT found?!!
I've tried EVERYTHING I can think of:
- adding "using MSUtils;" (didn't work);
- deploying to the GAC (didn't work, and had to add strong name to the assembly as well);
- re-adding the actual Interop.MSUtil.dll to the project (which I perceive was redundant & bad);
This is supposed to be a straightforward problem, but all I can guess is that when this code lives in a web part that lives in a SHAREPOINT environment... "something" happens.
Any genuine, productive help will be answered with an immediate shipment of the beer of The Helper's choice.
Cheers,
- Mark, Sharepoint Consultant | VOGTLAND | mark.vogt@vogtland.ws