You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Christopher Currens (JIRA)" <ji...@apache.org> on 2012/08/14 18:06:38 UTC

[jira] [Created] (LUCENENET-500) Lucene fails to run in medium trust ASP.NET Application

Christopher Currens created LUCENENET-500:
---------------------------------------------

             Summary: Lucene fails to run in medium trust ASP.NET Application
                 Key: LUCENENET-500
                 URL: https://issues.apache.org/jira/browse/LUCENENET-500
             Project: Lucene.Net
          Issue Type: Bug
          Components: Lucene.Net Core
    Affects Versions: Lucene.Net 3.0.3
            Reporter: Simon Svensson
            Assignee: Christopher Currens
             Fix For: Lucene.Net 3.0.3


I'm having trouble upgrading a web application running under medium trust from 2.9.4 to 3.0.3. Code that previously worked now throws a SecurityException.

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   Lucene.Net.Support.WeakKey`1..ctor(T key) +0
   Lucene.Net.Support.WeakDictionary`2.get_Item(TKey key) +113
   Lucene.Net.Util.DefaultAttributeFactory.GetClassForInterface() +178
   Lucene.Net.Util.DefaultAttributeFactory.CreateAttributeInstance() +95
   Lucene.Net.Util.AttributeSource.AddAttribute() +375
   Lucene.Net.Analysis.CharTokenizer..ctor(TextReader input) +126
   Lucene.Net.Analysis.WhitespaceTokenizer..ctor(TextReader in) +37


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (LUCENENET-500) Lucene fails to run in medium trust ASP.NET Application

Posted by "Christopher Currens (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Currens resolved LUCENENET-500.
-------------------------------------------

    Resolution: Fixed

Issue was in the WeakKey<T> class in WeakDictionary.cs.  A generic wrapper for WeakReference was being used but was inheriting from WeakReference which requires UnmanagedCode security permissions.  Removing the wrapper and doing casting instead fixes the permissions issue.
                
> Lucene fails to run in medium trust ASP.NET Application
> -------------------------------------------------------
>
>                 Key: LUCENENET-500
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-500
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net Core
>    Affects Versions: Lucene.Net 3.0.3
>            Reporter: Simon Svensson
>            Assignee: Christopher Currens
>             Fix For: Lucene.Net 3.0.3
>
>
> I'm having trouble upgrading a web application running under medium trust from 2.9.4 to 3.0.3. Code that previously worked now throws a SecurityException.
> [SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
>    Lucene.Net.Support.WeakKey`1..ctor(T key) +0
>    Lucene.Net.Support.WeakDictionary`2.get_Item(TKey key) +113
>    Lucene.Net.Util.DefaultAttributeFactory.GetClassForInterface() +178
>    Lucene.Net.Util.DefaultAttributeFactory.CreateAttributeInstance() +95
>    Lucene.Net.Util.AttributeSource.AddAttribute() +375
>    Lucene.Net.Analysis.CharTokenizer..ctor(TextReader input) +126
>    Lucene.Net.Analysis.WhitespaceTokenizer..ctor(TextReader in) +37

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira