[VS 2017] System.DllNotFoundException : Unable to load DLL 'libuv'
![[VS 2017] System.DllNotFoundException : Unable to load DLL 'libuv'](/content/images/size/w2000/2017/04/vs_2017-3.png)
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:
- [VS 2017] -Erro de compilação TS2339
- [VS 2017] -System.IO.FileLoadException: Could not load file or assembly
- [VS 2017] Razor Compilation CompilationFailedException
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.