English 中文(简体)
Lucene .NET 2.3.2 Security Exception - Medium trust Issues
原标题:

I m only partially able to get Lucene .NET to work on GoDaddy. It throws a security exception on this line:

Hits hits = searcher.Search(query, filter);

Here are the details of this 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 for the permission of type  System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  failed.

    [SecurityException: Request for the permission of type  System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  failed.]
   WeakHashTable.set_Item(Object key, Object value) in SupportClass.cs:1231
   Lucene.Net.Search.CachingWrapperFilter.Bits(IndexReader reader) in CachingWrapperFilter.cs:69
   Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, HitCollector results) in IndexSearcher.cs:175
   Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Int32 nDocs) in IndexSearcher.cs:156
   Lucene.Net.Search.Hits.GetMoreDocs(Int32 min) in Hits.cs:104
   Lucene.Net.Search.Hits..ctor(Searcher s, Query q, Filter f) in Hits.cs:67
   Lucene.Net.Search.Searcher.Search(Query query, Filter filter) in Searcher.cs:57
   details.RetrieveDocument() in d:hosting5304481htmldetails.aspx.cs:42
   details.Page_Load(Object sender, EventArgs e) in d:hosting5304481htmldetails.aspx.cs:28
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.details_aspx.ProcessRequest(HttpContext context) in App_Web_pux0zsik.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Before I give up on GoDaddy and move to DiscountASP, I wanted to check if anyone would know how I can tweak the code to operate fully in a Medium Trust environment.

Thanks.

问题回答

I have answered a different question on getting Lucene.Net to work in medium trust. This is on newer versions of the library.

Lucene.NET in medium trust





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签