Search code examples
.net-coredotfuscator

Dotfuscator 5.3 (from Visual Studio 15.3) doesn't obfuscate .NETStandard 2.0 .DLL


When running the latest Dotfuscator CE (comes with VS 2017, the latest updates and .NET Core 2.0 SDK installed), I'm getting errors like this when processing .NET Standard 2.0 .DLL:

Couldn't load external type because its assembly can't be found: System.Security.SecurityRuleSet,netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

What can I do? I thought maybe Dotfuscator does not find .NET Core 2.0 dlls so I added "c:\Program Files\dotnet\sdk\2.0.0\Microsoft\Microsoft.NET.Build.Extensions\net461\lib" path to DEVPATH and activated developmentMode in machine.config but it didn't help much. In the logs, it was clear that Dotfuscator now "sees" DEVPATH folder and the error message became slightly different but it's still there.

Couldn't load external type because its assembly can't be found: System.Net.Sockets.NetworkStream,netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

It's working fine if I process .NET Core 1.1 .DLL (.NET Standard 1.3). Only .NET Core 2.0 fails.

Dotfuscator CE doesn't seem to have any public forum (they provide support for their commercial version only), that's why I'm asking here.


Solution

  • For now, the quickest solution is probably to copy the netstandard.dll file from C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\ref to the same location as your input assembly.

    Disclaimer, I work for PreEmptive Solutions