I'm having problems with IKVM.Maven.SDK - to simplify things, I created a basic .Net 6.0 console app that uses slf4j to log "Hello World" - as per https://www.slf4j.org/manual.html, but in .Net.
Despite adding MavenReferences to org.slf4j:slf4j-api and org.slf4j:slf4j-simple, I still get the warnings:
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
slf4j.org says "This warning is printed because no slf4j provider (or binding) could be found on your class path."
How do I set class path with IKVM / IKVM.Maven.SDK?
My csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IKVM.Maven.Sdk" Version="1.5.5" />
<MavenReference Include="org.slf4j:slf4j-api" Version="2.0.9" />
<MavenReference Include="org.slf4j:slf4j-simple" Version="2.0.9" />
</ItemGroup>
</Project>
My Program.cs file:
using org.slf4j;
Logger logger = LoggerFactory.getLogger("IkvmLogTests");
logger.info("Hello, World!");
I tried adding a user environment variable set to where Maven is downloading
$env:CLASSPATH: C:\Users\matt\.m2\repository
And on build in Visual Studio that directory does get populated with the jar files for slf4j-api and slf4j-simple, (for example for slf4j-api the file C:\Users\matt\.m2\repository\org\slf4j\slf4j-api\2.0.9\slf4j-api-2.0.9.jar is there).
I tried adding
<PackageReference Include="IKVM" Version="8.6.2" />
But no change to result.
What am I missing?
I just needed to preload any dynamic assemblies (thanks to a response from wasabii on github, one of the main sponsors/contributors to IKVM.Maven.Sdk)