Matthias,

There could be a couple of things happening here. The DefaultCodecFactory uses 
reflection first to get a list of all of the codecs, then it uses it again to 
instantiate the requested codec.

To narrow it down, is the list at Codec.AvailableCodecs() populated with codecs 
or not? Could you post the values that you see there?

Thanks,
Shad Storhaug (NightOwl888)


-----Original Message-----
From: Matthias Strauss - xRM1 Business Solutions 
[mailto:[email protected]] 
Sent: Wednesday, May 17, 2017 4:21 PM
To: [email protected]
Cc: [email protected]
Subject: RE: Problems when running a search in my production environment

Hey Itamar,

I'm still fighting with it. I got it to work in non-sandboxed mode by changing 
the following line in AttributeSource.cs from

string name = attClass.FullName.Replace(attClass.Name, 
attClass.Name.Substring(1)) + ", " + attClass.GetTypeInfo().Assembly.FullName;

to

string name = attClass.FullName.Replace(attClass.Name, 
attClass.Name.Substring(1));

My simple search is working now, but not in sandboxed (partial trust) mode.
There it fails to get the default Codec when initializing the IndexWriter.

Do you have any ideas?

Best Regards,
Matthias


-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Itamar Syn-Hershko
Sent: Montag, 15. Mai 2017 17:45
To: [email protected]
Subject: Re: Problems when running a search in my production environment

Does this work on production for you without ILMerging? if yes, then that'd be 
the problem

--

Itamar Syn-Hershko
Freelance Developer & Consultant
Elasticsearch Partner
Microsoft MVP | Lucene.NET PMC
http://code972.com | @synhershko <https://twitter.com/synhershko> 
http://BigDataBoutique.co.il/

On Mon, May 15, 2017 at 6:43 PM, Matthias Strauss - xRM1 Business Solutions 
<[email protected]> wrote:

> 1.      "Could not instantiate implementing class for Lucene.Net.Analysis.
> TokenAttributes.ICharTermAttribute"
>
> For Sandbox mode:
> 2.      "The type initializer for 'Lucene.Net.Codecs.Codec' threw an
> exception." at Lucene.Net.Codecs.Codec.get_Default()
>         "Unable to load one or more of the requested types. Retrieve 
> the LoaderExceptions property for more information."
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] 
> On Behalf Of Itamar Syn-Hershko
> Sent: Montag, 15. Mai 2017 17:20
> To: [email protected]
> Subject: Re: Problems when running a search in my production 
> environment
>
> What is the exact exception(s) ?
>
> --
>
> Itamar Syn-Hershko
> Freelance Developer & Consultant
> Elasticsearch Partner
> Microsoft MVP | Lucene.NET PMC
> http://code972.com | @synhershko <https://twitter.com/synhershko> 
> http://BigDataBoutique.co.il/
>
> On Mon, May 15, 2017 at 6:02 PM, Matthias Strauss - xRM1 Business 
> Solutions <[email protected]> wrote:
>
> > Hey guys,
> >
> > I'm not sure if this is a thing for the user or dev mailing list, 
> > but
> I've
> > got a problem running a basic search in my production environment (CRM).
> >
> >
> > 1.       When adding a simple document to my IndexWriter I will get a
> > runtime error in the following location:
> > Lucene.Net\Util\AttributeSource.cs
> > internal static Type GetClassForInterface<T>() where T : IAttribute 
> > It crashes at: "attClass.GetTypeInfo()"
> >
> > So I think this method is a feature of mscorlib.dll, but why is it 
> > crashing on my server and not on my local machine?
> >
> >
> > 2.       When running the code in sandbox mode (partially trusted code)
> my
> > sample app crashes even earlier when initializing the IndexWriter 
> > (with
> > RamDirectory) at:
> > Lucene.Net\Index\LiveIndexWriterConfig.cs
> >                                 internal 
> > LiveIndexWriterConfig(Analyzer analyzer, LuceneVersion matchVersion)
> > Exception: "Unable to load one or more of the requested types. 
> > Retrieve the LoaderExceptions property for more information." at 
> > source
> "mscorlib".
> >
> > Locally the code is working fine.
> > I'm merging my code with ILMerge. Could this be the cause of the problem?
> > When I merge the 4 basic Lucene.Net dll's into a single one, it's 
> > still working fine locally.
> >
>

Reply via email to