-
Notifications
You must be signed in to change notification settings - Fork 528
Unable to load DLL 'libuv' after migrating to Visual Studio 2017 #1625
Comments
@capiono can you share your *.csproj file? |
In host.Run(); |
@BorisDli can you share your *.csproj file? We suspect this is an error in .NET Core SDK, not Kestrel itself, but it's hard to know without a repro. |
Thanks, that helps. Your csproj has these lines: <PropertyGroup>
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> There is a conflict in your project about which CPU architecture to target. The line I'd recommend removing RuntimeIdentifier unless there is some other reason you need it. |
Closing as external to Kestrel. @capiono if you've identified an error not solved by my previous comments, we can re-open for further investigation. |
@natemcmaster im just hitting this because i wanna get an x86 build for azure. there are two options:
|
NuGet has new first class features for packaging native assets https://docs.microsoft.com/en-us/dotnet/core/rid-catalog. |
@JanEggers unlike .NET Core, .NET Framework does not provide a built-in mechanism for loading native libraries based on the current process architecture. To workaround this, .NET Framework application typically compile as either x86 or x64. AnyCPU only works if the app is completely managed code. Libuv is native, not managed. As you've suggested, it may be possible for Kestrel to workaround the AnyCPU limitation, but as of 2.0.0 we haven't done this. |
I can confirm this issue. |
Just add |
For me at least, I had to install Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv (in nuget) to fix this. It was only giving me an issue for Linux, not Windows. |
Had to inject |
@Salgat: This one fixed it for me! |
In case you have integration tests (or other dependent projects), they would also need the runtime identifier. |
I'm seeing this error on Windows while trying to follow this tutorial: https://scotch.io/@rui/how-to-build-a-cross-platform-desktop-application-with-electron-and-net-core Can anyone explain what's wrong with the tutorial? I've read the several closed issues on this repo for this error and the only advice I can understand so far is "use core instead of framework" and "specify x64", which as far as I can tell I've already done. Is some part of the tutorial out of date? EDIT: OK, after some more experimenting, this works: <RuntimeIdentifiers>win7-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<BaseNuGetRuntimeIdentifier>win7-x64;osx-x64;linux-x64</BaseNuGetRuntimeIdentifier> And this doesn't: <RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<BaseNuGetRuntimeIdentifier>win-x64;osx-x64;linux-x64</BaseNuGetRuntimeIdentifier> I tried using the latter because I don't want my executable bound to a specific version of Windows (and those are all valid values for this field according to the MS docs for it). Is that just misguided? What is the actual effect of choosing a specific version of Windows in this field? |
My project was created in VS 2015, targeting net461.
I migrated to VS 2017, now I can't run my application when Targeting Platform is set to x64 or AnyCPU.
works when Targeting Platform is set to x86.
when Targeting Platform is set to x64 or AnyCPU I get this error at this line:
host.Run();
Error
Error is occurring in both IIS Express and IIS.
I want to be able to build and run in IIS either targeting x64 or AnyCPU.
The text was updated successfully, but these errors were encountered: