View Full Version : ZoomASPX.dll giving error in ASP.NET website
blumenhause
04-21-2009, 02:40 PM
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.
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 (http://www.wrensoft.com/zoom/support/aspdotnet.html).
blumenhause
04-22-2009, 04:33 AM
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
blumenhause
04-22-2009, 12:16 PM
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 (http://www.wrensoft.com/zoom/support/aspdotnet.html).
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.
wrensoft
04-22-2009, 12:24 PM
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)
blumenhause
04-23-2009, 06:08 AM
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.
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.
blumenhause
04-23-2009, 07:32 AM
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
blumenhause
04-24-2009, 07:58 AM
Hi Ray,
Any idea why this happens? I'll anyway contact the hosting provider and request to give full trust.
Regards,
Manoj
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.
blumenhause
04-28-2009, 05:31 AM
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
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.
blumenhause
04-28-2009, 11:24 AM
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 (http://www.ohigroup.com/search.exe) 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?
wrensoft
04-28-2009, 12:21 PM
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?
blumenhause
04-28-2009, 12:45 PM
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?
You do not have to use the ASP.NET version of the search script just because your website is built on ASP.NET. You can use any of the other scripting platforms available on your server. Your hosting plan should say whether your account/server will support PHP, Classic ASP, and/or CGI in addition to ASP.NET.
The advantage to using the same scripting platform as what your site is built on is that you can integrate the search page better in some cases. For example, you may have headers and footers on every page which use ASP.NET code. You won't be able to use this easily on a PHP search page (for example), but it doesn't mean you can't have a PHP search page in the middle of your ASP.NET website that looks just like the rest of your site.
I would recommend checking your hosting plan and seeing exactly what's available to you. If it's not clear, ask your hosting company. I would suspect that "Classic ASP" (also known as just plain "ASP" without the ".NET") should be available - it's one of the minimal services that even the cheapest IIS hosting plans offer.
See this FAQ for more details:
Q. What is PHP, ASP, CGI or JavaScript? How do I determine which one I should use? (http://www.wrensoft.com/zoom/support/platforms.html)
jcyl29
03-18-2010, 06:48 PM
Hi, I am having similar issues with a client's site that I am working on. Their hosting service will not allow full trust security level. That being the case, is zoom search not usable unless the hosting server has full security level access?
wrensoft
03-18-2010, 11:16 PM
You need to check what scripting options your host does support. Then pick the option that your host allows, or move to a new host that offers more options.
Zoom V6 supports CGI, PHP, ASP, .NET and Javascript.
Javascript is client side, so it works with any site.
pathfinder
10-28-2011, 12:47 AM
Very interesting thread. I am currently trying out the PHP flavor in my ASP.NET app. Could not get the CGI to work due to security measures mentioned above. It does search but does not crawl through my dynamic pages. But I am determined to make this work. My mission is to make my ecommerce app workable for the small entrepreneur who can not afford much beyond a shared hosting at godaddy. If I can make this work on these cheap servers, I am going to make all my clients kick out forty-nine bucks for the Standard Edition. OK, too long winded, been sitting here for eleven hours now and too much coffee.
If anyone has a clue how I might attempt a crawl through my asp.net dynamic pages...well, I'd be grateful.
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.