« Previous Next »

Thread: Request for Help: Trying to put Logparser COM object into Sharepoint (C#)WEB PART; builds but error message says can't find Interop.MSUtil (even when it IS there)?...

Last post 01-19-2006 11:48 AM by LogParser User : DEinspanjer. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 01-18-2006, 1:49 PM

    Request for Help: Trying to put Logparser COM object into Sharepoint (C#)WEB PART; builds but error message says can't find Interop.MSUtil (even when it IS there)?...

    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

  • 01-18-2006, 2:47 PM In reply to

    RE: Request for Help: Trying to put Logparser COM object into Sharepoint (C#)WEB PART; builds but error message says can't find Interop.MSUtil (even when it IS there)?...

    This is not the help that will get me a shipment of beer (which is fine since I dislike beer but I did want to mention that when you get into these inscrutable file not found type of errors, sometimes FileMon from Sysinternals can help give you an idea. You can set it to log only errors and at least get a better sense of where exactly the file not found or security error is occurring in the grand scheme of things.

    Best of luck in figuring it out. :/

  • 01-18-2006, 3:33 PM In reply to

    RE: Request for Help: Trying to put Logparser COM object into Sharepoint (C#)WEB PART; builds but error message says can't find Interop.MSUtil (even when it IS there)?...

    Daniel,

    Hmmm - interesting suggestions...
    I downloaded & installed Filemon (will add tools one at a time, testing each to see if it's useful before moving on),
    and got some possibly-useful clues.

    I started Filemon, refreshed (re-requested) the web part page with the offending web part code, and got a mixture of success & failure log entries in Filemon.

    Here is the entire snippet of the failure-related Filemon logfile lines:
    3:13:07 PM Maxthon.exe:3868 QUERY INFORMATION C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5\index.dat SUCCESS Length: 688128 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\2135a508\8d69a834\Interop.MSUtil.DLL NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\2135a508\8d69a834\Interop.MSUtil\Interop.MSUtil.DLL PATH NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\inetpub\wwwroot\bin\Interop.MSUtil.DLL NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\inetpub\wwwroot\bin\Interop.MSUtil\Interop.MSUtil.DLL PATH NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\2135a508\8d69a834\Interop.MSUtil.EXE NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\2135a508\8d69a834\Interop.MSUtil\Interop.MSUtil.EXE PATH NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\inetpub\wwwroot\bin\Interop.MSUtil.EXE NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\inetpub\wwwroot\bin\Interop.MSUtil\Interop.MSUtil.EXE PATH NOT FOUND Attributes: Error 
    3:13:07 PM w3wp.exe:1952 QUERY INFORMATION C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Template\1033\SPS\default.aspx SUCCESS Attributes: A
     

    As you may have expected, there ARE a number of errors, but I don't know how to accurately interpret them.
    Are they:
    - problems with the way I've ADDED the offending COM (dll) assembly to my VS.NET project?
    - problems with the way I've BUILT the solution - is there something that needs to be explicitly added to my CAB output?
    - problems with OTHER manual housekeeping-related tasks - like copying the Interop.MSUtil.dll to the location the above queries are LOOKING?
    - other stuff I've not thought of?

    I sense we may be on the right track, so help me (and everyone else in this boat) out, and name your beer-equivalent reward...
    ;-)

    In the meantime, I'll try to decipher the above entries, and report back my progress/findings.

    Cheers,

    - Mark Vogt, Sharepoint Consultant | mark.vogt@vogtland.ws

  • 01-19-2006, 8:25 AM In reply to

    RE: Request for Help: Trying to put Logparser COM object into Sharepoint (C#)WEB PART; builds but error message says can't find Interop.MSUtil (even when it IS there)?...

    Greetings all,

    Well, Filemon came to the rescue, and showed me that my portal server was trying to find the Interop.MSUtil.dll assembly, but it wasn't in any of the paths the poral knew to look.

    When I:
    1. manually copied the Interop.MSUtil.dll to the same location my web part's assembly was being deployed; and
    2. upgraded my web apps' trust level from "WSS_Medium" to "Full" (in the web.config file), EVERYTHING WORKED !!

    All I have to do now is:
    1. find out why this Interop.MSUtil.dll is not being included in my Deployment Project's CAB; and
    2. determine the MINIMUM security privileges required (somewhere between WSS_Medium and Full) to access server event logs.

    Once I determine this, I'll summarize in a final posting so it's useful for everyone else.

    Thanks to DE - send me an email address to mark_vogt@vogtland.ws, and I'll try to send you a modest gift certificate to imusic.com or the like - it's the least I can do for some truly useful and timely advice !

    Cheers,

    - Mark Vogt | Sharepoint consultant | mark_vogt@vogtland.ws

  • 01-19-2006, 11:48 AM In reply to

    RE: Request for Help: Trying to put Logparser COM object into Sharepoint (C#)WEB PART; builds but error message says can't find Interop.MSUtil (even when it IS there)?...

    Nothing more than a simple thanks is necessary. I'm *very* happy to hear that after some study, the Filemon logs were able to help you trace down the problem.

    I can't tell you how many times in my career Sysinternals utilities have bailed me out.
    I use probably half a dozen of them on a weekly basis.
Page 1 of 1 (5 items)
Microsoft Communities