Water fails to run .net core app with nuget reference

Hi

I have .net core project TestNuget.zip (277.6 KB)
with nuget reference and want to run the console app using the latest stable Elements version but I get error :

~> Process ConsoleApplication6 started
Error:
  An assembly specified in the application dependencies manifest (ConsoleApplication6.deps.json) was not found:
    package: 'Microsoft.Win32.SystemEvents', version: '4.5.0'
    path: 'runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll'

Water cannot find an assembly from nuget reference. I checked ConsoleApplication6.deps.json and there runtimeTargets points to “runtimes\win\lib\netcoreapp2.0\Microsoft.Win32.SystemEvents.dll” which is not valid for nuget reference. I also tried to use “Copy Local” option and although the files are copied to bin directory, the error remains. The only solution for now is to remove ConsoleApplication6.deps.json file.
How can I run such project under Water ?

For me it runs fine, except for this exception, which sounds like it might be a .NETCore/macOS limitation (Mono has issues with gdiplus too); when I comment out the creation of the bitmap, it runs without error…

Unhandled Exception: System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception. —> System.DllNotFoundException: Unable to load DLL ‘libgdiplus’: The specified module could not be found.

Same on Windows (I did have to change the runtime version from 2.2.4 to 2.2.3 as I didn’t have the latter one), but it runs clean.

Hmm, so it must be Water version, I will try the weekend release.

Which version do you have? this hans’t really changed in the past few weeks…

.2400 stable

k, then nothing major changed since then. can you send me your Bin folder, so I can compare it to mine? I’m attaching my copy, does that run for you (you might need to adjust the paths in ConsoleApplication6.runtimeconfig.dev.json)?

Debug.zip (241.3 KB)

Isn’t that the same issue I have with the deps file? It should contain _._

Could be, but iirc your issue repros for me, and I just didn’t know what was wrong, while this one runs fine for me. Does Artur’s project work for you, John?

It works fine for me in water both with and without copy local

ConsoleApp21.deps.json (2.5 KB)
ConsoleApplication6.deps.json (2.7 KB)
The deps files are a bit different.

water is using \ whereas visual studio is using /

Also the sha512 are different

Debug.zip (233.2 KB) using v.2403 but still doesn’t work.

Curious. Will fix. Does the Elements version ion your project work if you man sally reface these?

Yeah, I would have been surprised if that change anything, since I didn’t touch this in weeks.

Can you too test if changing \ to / in the .deps.json makes it work? That said, my json file on Windows also had \ and it still worked fine for me…

it still works with . I guess dotnet doesnt care if you use either. I was wondering what version of dotnet Artur was using

Next commit should have this fixed and always use /. (not 2305, which is already built)

doesn’t work either.

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview5-011568
 Commit:    b487ff10aa

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview5-011568\

Host (useful for support):
  Version: 3.0.0-preview5-27626-15
  Commit:  61f30f5a23

.NET Core SDKs installed:
  1.1.13 [C:\Program Files\dotnet\sdk]
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.505 [C:\Program Files\dotnet\sdk]
  2.1.602 [C:\Program Files\dotnet\sdk]
  2.2.106 [C:\Program Files\dotnet\sdk]
  2.2.203 [C:\Program Files\dotnet\sdk]
  3.0.100-preview5-011568 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview5-19227-01 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Well, thats a different issue? it cant find the specific runtime version that the app was built for installed on your system…

Maybe the .net core 3.0.100-preview5 is messing here. Why it is searching the nuget package dlls in .net core runtime directory? Or I’m misinterpreting the error message. The path “‘runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll’” is relative to which directory?

Could bee but I too have 3.0 preview installed…

this whole deps.json mess is a mystery to me as much as it is to you…