Closed podlodkin closed 1 year ago
Only available/usable on .NET Framework (as in your case).
Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location.
Exceptions NotImplementedException .NET Core and .NET 5+ only: In all cases.
For .NET Core this won't work, at all.
For .NET Core this won't work, at al.
Maybe we need different rootPath algorithms for .net core and .net framework. Actual algorithm doesn't work for .net 4.8.
Shadow-Copying is a nightmare, and may or may not work (experimentally) in .NET Core as well.
Maybe we can use (optionally) an environmental parameter (as IKVM_PATH).
We'll just have it read out of ConfigurationManager at a higher priority. But yeah shadow copy is evil.
File: IKVM.Runtime\JVM.Properties.cs
Function: GetHomePath
Code:
var rootPath = Path.GetDirectoryName(typeof(JVM).Assembly.Location);
returns “shadow-copying” directory path. For example,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\c027dea8\2d30b62c\assembly\dl3\e775bdb1\00e9c755_4899d901
There is no “ikvm” catalogue and as the result we have an error:
Could not locate ikvm.home when establishing VFS.
Rather than calling typeof(JVM).Assembly.Location, you can call typeof(JVM).Assembly.CodeBase which gives you the original install directory (which contains ikvm folder).
P.s. This is not a constant error - it depends on environmental configuration (VS, IIS, ...).