paulirwin commented on issue #1223:
URL: https://github.com/apache/lucenenet/issues/1223#issuecomment-3698221422
@nasirodin Thank you for filing this issue, but I cannot reproduce it with
your example code. I've tried this on .NET Framework 4.8 (as originally
reported) and .NET 10, on Windows and macOS (.NET 10 only). That particular
stack trace in your issue is when it is trying to load the Lucene.Net.Codecs
assembly, so I tried with and without that assembly added as a package
reference. Can you provide a sample repo where it fails or let me know what I'm
missing? The code below runs without exception.
```c#
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Miscellaneous;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Codecs.Lucene46;
using Lucene.Net.Index;
using Lucene.Net.Store;
using Lucene.Net.Util;
const LuceneVersion Version = LuceneVersion.LUCENE_48;
var directory = new RAMDirectory();
var analyzerMap = new Dictionary<string, Analyzer>();
var analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(Version),
analyzerMap);
IndexWriterConfig indexConfig = new(Version, analyzer)
{
Codec = new Lucene46Codec()
};
var writer = new IndexWriter(directory, indexConfig);
```
csproj:
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00017" />
<PackageReference Include="Lucene.Net.Analysis.Common"
Version="4.8.0-beta00017" />
<PackageReference Include="Lucene.Net.Codecs"
Version="4.8.0-beta00017" />
</ItemGroup>
</Project>
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]