lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corey Trager (JIRA)" <>
Subject [jira] Commented: (LUCENENET-169) Changes to make Lucene.NET compatible with ASP.NET Medium Trust Level, in hosting environments (like GoDaddy...)
Date Sat, 13 Jun 2009 20:02:08 GMT


Corey Trager commented on LUCENENET-169:

@Luis -  Here's what I did today.    I fetched the latest code from svn, built, and tried
to run.   I got an error message "Required permissions cannot be acquired".   The callstack
does not tell me what the offending code or even permission is.     I applied the changes
already documented here (I only needed #2), but that didn't help.

I then fetched the Lucene.NET cod with revision 703747 and I was able to run under Medium
Trust on my machine without alterning the code at all.    It was way back in October when
I had the problems on GoDaddy and I'm not sure if my problems were ever with the default Medium
Trust configuration like my machine.    Maybe GoDaddy's customized their Medium Trust. configuration?
    I don't want to experiment with my site on GoDaddy because I don't want the disruption.

It would take me a lot of trial and error to figure out what the changes are since svn revision
703747 that conflict with my own default Medium Trust, and then to experiment with workarounds.....
    I think I'm just going to have to stick wih 703747.

We are the only ones who would like to see Lucene.NET compatible with Medium Trust:

> Changes to make Lucene.NET compatible with ASP.NET  Medium Trust Level, in hosting environments
(like GoDaddy...)
> -----------------------------------------------------------------------------------------------------------------
>                 Key: LUCENENET-169
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Improvement
>         Environment: ASP.NET
>            Reporter: Corey Trager
>         Attachments: FSDirectory.patch
> Microsoft has a configuration file for shared hosting for what they call "Medium Trust".
  There are a couple places in FSDirectory.cs  that violate the restrictions of Medium Trust,
but I coded workarounds, shown below.
> #1) 
> // Corey Trager, Oct 2008: Commented call to GetTempPath to workaround permission restrictions
at shared host.
> // LOCK_DIR isn't used anyway.
> public static readonly System.String LOCK_DIR = null; // SupportClass.AppSettings.Get("Lucene.Net.lockDir",
> #2)
> 		/// <summary>Returns an array of strings, one for each Lucene index file in the
directory. </summary>
> 		public override System.String[] List()
> 		{
> /* Changes by Corey Trager, Oct 2008, to workaround permission restrictions at shared
host */
>                System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(directory.FullName);
> 		System.IO.FileInfo[] files = dir.GetFiles();
>                 string[] list = new string[files.Length];
>                 for (int i = 0; i < files.Length; i++)
>                 {
>                     list[i] = files[i].Name;
>                 }
>                 return list;
> /* end of changes */
> //            System.String[] files = SupportClass.FileSupport.GetLuceneIndexFiles(directory.FullName,
> //            for (int i = 0; i < files.Length; i++)
> //            {
> //                System.IO.FileInfo fi = new System.IO.FileInfo(files[i]);
> //                files[i] = fi.Name;
> //            }
> //			  return files;
> 		}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message