You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2020/07/20 16:38:40 UTC

[GitHub] [lucenenet] ensemblebd opened a new issue #311: Bug or environment GAC? Method 'get_properties' in ConfigurationBuilder does not have an impl.

ensemblebd opened a new issue #311:
URL: https://github.com/apache/lucenenet/issues/311


   After upgrading from beta7 to **beta10**, I am now receiving an error:
   ```
   System.TypeInitializationException: The type initializer for 'Lucene.Net.Diagnostics.Debugging' threw an exception. 
   ---> System.TypeInitializationException: The type initializer for 'Lucene.Net.Configuration.ConfigurationSettings' threw an exception. 
   ---> System.TypeLoadException: Method 'get_Properties' in type 'Lucene.Net.Configuration.ConfigurationBuilder' from assembly 'Lucene.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=85089178b9ac3181' does not have an implementation.
      at Lucene.Net.Configuration.DefaultConfigurationFactory..ctor()
      at Lucene.Net.Configuration.ConfigurationSettings..cctor()
      --- End of inner exception stack trace ---
      at Lucene.Net.Configuration.ConfigurationSettings.GetConfigurationFactory()
      at Lucene.Net.Util.Properties.GetProperty[T](String key, T defaultValue, Func`2 conversionFunction)
      at Lucene.Net.Diagnostics.Debugging..cctor()
      --- End of inner exception stack trace ---
      at Lucene.Net.Analysis.Tokenizer.SetReader(TextReader input)
      at Lucene.Net.Analysis.Analyzer.GetTokenStream(String fieldName, TextReader reader)
      at Lucene.Net.Util.QueryBuilder.CreateFieldQuery(Analyzer analyzer, Occur operator, String field, String queryText, Boolean quoted, Int32 phraseSlop)
      at Lucene.Net.Util.QueryBuilder.CreateBooleanQuery(String field, String queryText, Occur operator)```
   
   I decompiled the .dll's to verify the class property exists. 
   However I noticed in changelog for the versions many items were marked Internal instead of public.
   But both `.Debugging` and `.Configuration` namespaces are internal to the main `Lucene.Net` dll, so it couldn't possibly lack access, right?
   I'm not quite sure how it's failing to resolve the `Properties` property via `DefaultConfigurationFactory`  during the constructors of the `StandardAnalyzer`, or `SimpleAnalyzer`.
   
   Can anyone potentially point me in the right direction on this issue? Am at a grinding halt. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Re: [GitHub] [lucenenet] ensemblebd opened a new issue #311: Bug or environment GAC? Method 'get_properties' in ConfigurationBuilder does not have an impl.

Posted by Elad Margalit <el...@gmail.com>.
I managed to reproduce this, 
On AspNet (not AspNetCore)

Sent from my iPhone

> On 20 Jul 2020, at 19:38, GitBox <gi...@apache.org> wrote:
> 
> 
> ensemblebd opened a new issue #311:
> URL: https://github.com/apache/lucenenet/issues/311
> 
> 
>   After upgrading from beta7 to **beta10**, I am now receiving an error:
>   ```
>   System.TypeInitializationException: The type initializer for 'Lucene.Net.Diagnostics.Debugging' threw an exception. 
>   ---> System.TypeInitializationException: The type initializer for 'Lucene.Net.Configuration.ConfigurationSettings' threw an exception. 
>   ---> System.TypeLoadException: Method 'get_Properties' in type 'Lucene.Net.Configuration.ConfigurationBuilder' from assembly 'Lucene.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=85089178b9ac3181' does not have an implementation.
>      at Lucene.Net.Configuration.DefaultConfigurationFactory..ctor()
>      at Lucene.Net.Configuration.ConfigurationSettings..cctor()
>      --- End of inner exception stack trace ---
>      at Lucene.Net.Configuration.ConfigurationSettings.GetConfigurationFactory()
>      at Lucene.Net.Util.Properties.GetProperty[T](String key, T defaultValue, Func`2 conversionFunction)
>      at Lucene.Net.Diagnostics.Debugging..cctor()
>      --- End of inner exception stack trace ---
>      at Lucene.Net.Analysis.Tokenizer.SetReader(TextReader input)
>      at Lucene.Net.Analysis.Analyzer.GetTokenStream(String fieldName, TextReader reader)
>      at Lucene.Net.Util.QueryBuilder.CreateFieldQuery(Analyzer analyzer, Occur operator, String field, String queryText, Boolean quoted, Int32 phraseSlop)
>      at Lucene.Net.Util.QueryBuilder.CreateBooleanQuery(String field, String queryText, Occur operator)```
> 
>   I decompiled the .dll's to verify the class property exists. 
>   However I noticed in changelog for the versions many items were marked Internal instead of public.
>   But both `.Debugging` and `.Configuration` namespaces are internal to the main `Lucene.Net` dll, so it couldn't possibly lack access, right?
>   I'm not quite sure how it's failing to resolve the `Properties` property via `DefaultConfigurationFactory`  during the constructors of the `StandardAnalyzer`, or `SimpleAnalyzer`.
> 
>   Can anyone potentially point me in the right direction on this issue? Am at a grinding halt. 
> 
> 
> ----------------------------------------------------------------
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on to GitHub and use the
> URL above to go to the specific comment.
> 
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
> 
> 

[GitHub] [lucenenet] NightOwl888 closed issue #311: Method 'get_properties' in ConfigurationBuilder does not have an impl.

Posted by GitBox <gi...@apache.org>.
NightOwl888 closed issue #311:
URL: https://github.com/apache/lucenenet/issues/311


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] ensemblebd commented on issue #311: Method 'get_properties' in ConfigurationBuilder does not have an impl.

Posted by GitBox <gi...@apache.org>.
ensemblebd commented on issue #311:
URL: https://github.com/apache/lucenenet/issues/311#issuecomment-661311314


   Thank you so much!! 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #311: Method 'get_properties' in ConfigurationBuilder does not have an impl.

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #311:
URL: https://github.com/apache/lucenenet/issues/311#issuecomment-661310572


   Thanks for the report.
   
   I was able to reproduce this. It is only happening on .NET Framework and only if you are using `Microsoft.Extensions.Configuration` higher than version 1.1.2 within your project. For compatibility reasons, we reference `Microsoft.Extensions.Configuration.Abstractions` version 1.1.2 in .NET Framework, since higher versions only support .NET Framework 4.6.1 and higher.
   
   There was a breaking change introduced in `IConfigurationBuilder` between `Microsoft.Extensions.Configuration.Abstractions` version 1.1.2 and version 2.0.0 where `IConfigurationBuilder.Properties` was changed from `Dictionary<string, object>` to `IDictionary<string, object>` so the `DefaultConfigurationFactory` currently requires you to use components from `Microsoft.Extensions.Configuration` version 1.1.2 on .NET Framework.
   
   If downgrading `Microsoft.Extensions.Configuration` is not an option, then you must downgrade to `Lucene.Net` version 4.8.0-beta-00008.
   
   We need to get rid of the `IConfigurationBuilder` implementation to fix this problem, as the only requirement we have internally is to implement `IConfiguration` to provide a logical default that reads system variables. Unfortunately, this issue is also preventing .NET Framework users from providing their own `IConfigurationFactory` implementation to override because the exception occurs in the initialization before an alternative implementation can be set.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org