ConfuserEx: Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform

I’m having some issues running Confuser.CLI.exe under dotnet on Linux and MacOS.

$ dotnet Confuser.CLI.exe
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/davidtavarez/Development/ConfuserEx/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /Users/davidtavarez/Development/ConfuserEx/Confuser.CLI.runtimeconfig.json file specifying the appropriate framework.

$ dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

I did create the file called: Confuser.CLI.runtimeconfig.json:

{
  "runtimeOptions": {
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "2.2.2"
    }
  }
}

Now I have:

$ dotnet Confuser.CLI.exe

Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.ConsolePal.get_Title()
   at Confuser.CLI.Program.Main(String[] args)
[1]    16476 abort      dotnet Confuser.CLI.exe

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 34 (15 by maintainers)

Commits related to this issue

Most upvoted comments

So I fixed the bug itself and disabled reading the console title on systems other than windows. As you can read here the reading method is not implemented for unix-like systems.

The second problem you are facing it the missing runtime descriptor. This is because you are running the wrong file. Find the proper file for the .NET Core build here: ConfuserEx\Confuser.CLI\bin\Debug\netcoreapp2.1\Confuser.CLI.dll. This file also has the required .runtimeconfig.json. Simply run it with dotnet Confuser.CLI.dll.

How ever as of right now you have to build it yourself. The publishing of .NET Core build on the buildserver had some problems lately I not yet had time to debug. Both the debug and the release build should work just fine.

The issue has nothing to do with .NET Framework 2.0. I found the reason for the problem. It’s the special build script for the Unit Tests that causes the build for the test obfuscation targets to be triggered multiple times concurrently. This causes two compiler instances to access the same file at the same time and this way to build fails.