[VS 2017] System.DllNotFoundException : Unable to load DLL 'libuv'

[VS 2017] System.DllNotFoundException : Unable to load DLL 'libuv'

Ola pessoALL,

Achei que minha mini-série sobre migração para o VS 2017, mas ainda tenho um último post a fazer =).

Os outros posts:

Hoje vamos falar do erro: System.DllNotFoundException : Unable to load DLL 'libuv': The specified module could not be found.
Esse erro acontece em projetos Console ou Test e somente quando configurados para <TargetFramework>net461</TargetFramework>.

Após pesquisar um pouquinho achei essa issue que descreve em detalhes o problema. Vale a pena ler! Aqui vou listar apenas os workarounds da issue.

Workaround 1 - RuntimeIdentifier

No seu arquivo .csproj adicione a seguinte chave no primeiro <PropertyGroup>:

<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net461'">win7-x64</RuntimeIdentifier>

Workaround 2 - OutputType

No seu arquivo .csproj adicione a seguinte chave no primeiro <PropertyGroup>:

<OutputType>Exe</OutputType>

Prontinho pessoALL, problema resolvido! Nas próximas versões do dotnet provavelmente não teremos mais esse problema.
Espero ter ajudado, até a próxima.