PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

ZoomASPX.dll giving error in ASP.NET website

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ZoomASPX.dll giving error in ASP.NET website

    Hi, I was trying out the free cersion of Zoom Search and I was very much impressed with the ease of using it. However, while trying it on our live site, I got the following error:

    Required permissions cannot be acquired.
    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.Security.Policy.PolicyException: Required permissions cannot be acquired.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [PolicyException: Required permissions cannot be acquired.]
    System.Security.SecurityManager.ResolvePolicy(Evid ence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2770052
    System.Security.SecurityManager.ResolvePolicy(Evid ence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57

    [FileLoadException: Could not load file or assembly 'ZoomASPX, Version=1.0.3373.29966, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
    System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
    <snip>
    System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
    System.Web.MapHandlerExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +128
    System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +161

    I've gone through your documents and knowledgebase. This website is in a hosted environment and I cannot install the ASP.NET Native control there. But uploaded the zoomASPX.dll file on to the bin folder. Now the site does not load, it gives the above error. We are planning to buy your Professional edition because we have more than 50 pages to index.

    Regards,
    Manoj Velappan
    Muscat, Oman.

  • #2
    Originally posted by blumenhause View Post
    I've gone through your documents and knowledgebase. This website is in a hosted environment and I cannot install the ASP.NET Native control there. But uploaded the zoomASPX.dll file on to the bin folder. Now the site does not load, it gives the above error. We are planning to buy your Professional edition because we have more than 50 pages to index.
    Just uploading the "ZoomASPX.dll" file will not work. The server control needs to be installed with the "zoomaspx.msi" installer.

    If you do not have permissions to install this, perhaps you should consider using the CGI version or even the Classic ASP version? If you have an ASP.NET website, you can create an ASPX page which wraps the CGI as described here.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Thank you Ray, I appreciate it. Let me try using CGI wrapper and I'll let you know how it went.

      In the meantime, could you tell me what files the .msi installs and their location, do they make any registry changes?

      Also I want to uninstall this ASP.NET control so that I can test the CGI version.

      Regards,
      Manoj

      Comment


      • #4
        Originally posted by Ray View Post
        Just uploading the "ZoomASPX.dll" file will not work. The server control needs to be installed with the "zoomaspx.msi" installer.

        If you do not have permissions to install this, perhaps you should consider using the CGI version or even the Classic ASP version? If you have an ASP.NET website, you can create an ASPX page which wraps the CGI as described here.

        I tried to create an aspx wrapper, but i get the error on Line 20:

        The specified executable is not a valid Win32 application.
        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.ComponentModel.Win32Exception: The specified executable is not a valid Win32 application.

        Source Error:

        Line 18: psi.RedirectStandardOutput = true;
        Line 19: psi.UseShellExecute = false;
        Line 20: Process proc = Process.Start(psi);
        Line 21: proc.StandardOutput.ReadLine(); // skip the HTTP header line
        Line 22: string zoom_results = proc.StandardOutput.ReadToEnd(); // read from stdout

        Source File: e:\wwwroot\OhiWebsite\eSearch.aspx Line: 20

        Stack Trace:

        [Win32Exception (0x80004005): The specified executable is not a valid Win32 application.]
        System.Diagnostics.Process.StartWithCreateProcess( ProcessStartInfo startInfo) +1872
        System.Diagnostics.Process.Start() +69
        System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +49
        <snip>
        System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
        System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

        This is urgent for me, I'm working to solve this error. I'll post a message here if I'm able to rectify this error.

        Your help would be appreciated.

        Comment


        • #5
          Can you post the code you are using (lines 1 to 18 in particular).
          Are you sure you are using the Windows CGI (and not the Linux or Unix one)?
          Did you try initially calling the CGI directly from a browser (and not from a .NET script)

          Comment


          • #6
            Some improvement, still purpose not served!

            Hi,

            Thank you for your support. I solved the previous error; it was an issue with how I set the FileName property. Now this is the error:

            Security Exception
            Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

            Exception Details: System.Security.SecurityException: Request failed.

            Source Error:


            Line 23: proc.WaitForExit();
            Line 24: // Print the output
            Line 25: Response.Write(zoom_results);
            Line 26: %>
            Line 27: </asp:Content>


            Source File: e:\domains\o\ohigroup.com\user\htdocs\eSearch.aspx Line: 25

            Stack Trace:


            [SecurityException: Request failed.]
            ASP.esearch_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in e:\domains\o\ohigroup.com\user\htdocs\eSearch.aspx :25
            System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer, ICollection children) +98
            <snip>
            System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +18
            System.Web.UI.Page.ProcessRequest(HttpContext context) +49
            ASP.esearch_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\root\7a00315c\3f78b2bb\App_Web_rckfqbzp.0.cs :0
            System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +358
            System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +64

            http://www.ohigroup.com/eSearch.aspx?zoom_query=ddb

            I guess application needs full trust now that Response.Write line is throwing the error.

            Comment


            • #7
              Depends on what security policy you have enforced. I can't quite imagine what's blocking Response.Write(). Medium Trust has a few documented restrictions like: "Permissions are limited to what the application can access within the directory structure of the application" and "Limited rights to certain common environment variables". Not sure what else is happening in the rest of your ASPX page, or if you might have a Custom Trust level set.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment


              • #8
                This is my aspx page

                This is all the code I'm using:

                <%@ Page Language="C#" MasterPageFile="~/SiteMap.Master" Debug="true" AutoEventWireup="true" CodeBehind="eSearch.aspx.cs" Inherits="MySite.eSearch" Title="My Search" %>
                <%@ Import Namespace="System.IO" %>
                <%@ Import Namespace="System.Diagnostics" %>
                <asp:Content ID="Content1" ContentPlaceHolderID="midContent" runat="server">
                string paramStr = "";
                int parampos = Request.RawUrl.IndexOf("?");
                if (parampos >= 0)
                paramStr = Request.RawUrl.Substring(parampos + 1);

                System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
                psi.FileName = Server.MapPath("search.cgi");
                psi.EnvironmentVariables["REQUEST_METHOD"] = "GET";
                psi.EnvironmentVariables["QUERY_STRING"] = paramStr;
                psi.EnvironmentVariables["REMOTE_ADDR"] = Request.ServerVariables["REMOTE_ADDR"];
                psi.RedirectStandardInput = false;
                psi.RedirectStandardOutput = true;
                psi.UseShellExecute = false;
                System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);
                proc.StandardOutput.ReadLine(); // skip the HTTP header line
                string zoom_results = proc.StandardOutput.ReadToEnd(); // read from stdout
                proc.WaitForExit();
                // Print the output
                Response.Write(zoom_results);

                </asp:Content>


                It is a content page coz I'm using a Master page with a search textbox. On click of search button I'm redirecting to this page using :

                document.location.href='eSearch.aspx?zoom_query=' + URLEncode(document.getElementById('zoom_query').va lue);

                Regards,
                manoj

                Comment


                • #9
                  Any idea?

                  Hi Ray,

                  Any idea why this happens? I'll anyway contact the hosting provider and request to give full trust.

                  Regards,
                  Manoj

                  Comment


                  • #10
                    As mentioned above, we don't know what security policies may be in place on your server. There may be a Custom Trust level set. Requesting Full Trust with your host is a good way to proceed.
                    --Ray
                    Wrensoft Web Software
                    Sydney, Australia
                    Zoom Search Engine

                    Comment


                    • #11
                      They won't change trust level

                      Hi,

                      I've contacted the hosting provider and asked them to give full trust, this is what they said:
                      "We cannot change any of the variables or configuration on the Shared Platform, they are set to a safe and reliable settings to guarantee maximum reliability for all users."

                      So I guess I'm in trouble now. Is there another option, anything you can suggest that would help me, I'd grately appreciate it guys.

                      Regards,
                      Manoj

                      Comment


                      • #12
                        Have you tried accessing the CGI directly yet (as mentioned several times before)?

                        In theory, you should, because the instructions for the ASP.NET wrapper say clearly that you shouldn't be attempting the wrapper code until you have the CGI working and running.

                        If you missed that part of the instructions and you still have not confirmed whether the CGI is working (all you have to do is go to the URL where the CGI is hosted, e.g. http://mysite.com/cgi/search.cgi), then do so first. It might even be triggering your ASP.NET error (and it's pointing to the wrong line in the error report).

                        Now assuming the CGI is working fine, you could consider just having the search page as a CGI without it being an ASP.NET page. Then you'd just modify the template (search_template.html) so that it looks like the rest of your site.
                        --Ray
                        Wrensoft Web Software
                        Sydney, Australia
                        Zoom Search Engine

                        Comment


                        • #13
                          CGI error

                          Ok, I tried to access search.cgi directly and this was the result:
                          The specified CGI application misbehaved by not returning a complete set of HTTP headers.

                          I tried your CGI faq:
                          http://www.wrensoft.com/zoom/support/faq_cgi.html

                          I renamed search.cgi to search.exe, but when I access the page via:
                          My Site it asks me to save or open the cgi file, its not getting executed.

                          Installing the MS Hotfix is out of question since this is the hosting environment.

                          Is there anything else to try?

                          Comment


                          • #14
                            You should also see this page about setting up the CGI on IIS.
                            http://www.wrensoft.com/zoom/support/faq_cgi_iis.html
                            But is assumes you have the power to make configuration changes on your server.

                            To be honest. Shared hosting isn't the best for .NET development, and Microsoft have made it painful to configuration IIS to run a CGI. In a lot of IIS shared hosting situations the restrictions from the host mean you pretty much how no control over your server and it's configuration.

                            What about using the Classic ASP, or PHP options instead?

                            Comment


                            • #15
                              anything!!

                              Well, I agree that its a painful process dealing with these hosting providers. But you can't live without them for these small sites!

                              This is our company's group website, and I found an easy-to-implement search ad-in like Zoom after so much research. They want search functionality, no matter what.

                              This website is up and running and it is ASP.NET. So now I cannot make it entirely asp or php. Are you suggesting to make the search page as asp, will that work? What changes do I have to make for that?

                              Comment

                              Working...
                              X