More trouble with .Net Core App

I’m having trouble creating Oxygene .Net Core applications again (or still). To isolate and reproduce the problem, I have used the following test procedure:

I created a new project with Water and built it and ran it with the dotnet command. It worked fine. But when I add a reference to a NuGet package, running with the dotnet command no longer works:

Original project created with Water:

C:\Users\pmunts\ConsoleApplication>make
"C:/Program Files (x86)/RemObjects Software/Elements/Bin/EBuild" "ConsoleApplication.elements" --configuration:Release
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2018. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2347 (develop) built on talax, 20181123-151848. Commit 3758baa.

   Solution 'ConsoleApplication' built successfully.

C:\Users\pmunts\ConsoleApplication>dotnet ConsoleApplication.exe
The magic happens here.

The I added a reference to the NuGet package libremoteio-standard (using Water) and tried again:

C:\Users\pmunts\ConsoleApplication>diff ConsoleApplication.elements.orig ConsoleApplication.elements
39a40,42
>     <NuGetReference Include="libremoteio-standard:*">
>       <Private>True</Private>
>     </NuGetReference>

C:\Users\pmunts\ConsoleApplication>make
"C:/Program Files (x86)/RemObjects Software/Elements/Bin/EBuild" "ConsoleApplication.elements" --configuration:Release
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2018. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2347 (develop) built on talax, 20181123-151848. Commit 3758baa.

W: Package Microsoft.NETCore.App:2.2.0 has no deliverable for platform 'netcoreapp'.
   Reference 'Echoes' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\Echoes\Reference Assemblies\NETSTandard\Echoes.dll' via XML for target 'Echoes'.
   Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\Echoes\Reference Assemblies\NETSTandard\Elements.dll' via XML for target 'Echoes'.
   Reference 'libremoteio-standard' already was resolved to 'C:\Users\pmunts\AppData\Local\RemObjects Software\EBuild\Packages\NuGet\libremoteio-standard-1.0.6897.18860\lib\netstandard2.0\libremoteio-standard.dll' for target 'Echoes'.
   Reference 'HidSharp' already was resolved to 'C:\Users\pmunts\AppData\Local\RemObjects Software\EBuild\Packages\NuGet\hidsharp-2.0.5\lib\netstandard2.0\HidSharp.dll' for target 'Echoes'.
   RemObjects Elements (Oxygene, C#, Swift and Java) Compiler for .NET, Cocoa, Java and Island.
   Version 10.0.0.2347 (develop) built on talax, 20181123-151848. Commit 3758baa.
   Copyright 2003-2018 RemObjects Software, LLC. All rights reserved.

   Source file: C:\Users\pmunts\ConsoleApplication\Properties\Resources.Designer.pas
   Source file: C:\Users\pmunts\ConsoleApplication\Properties\Settings.Designer.pas
   Source file: C:\Users\pmunts\ConsoleApplication\Program.pas
   Source file: C:\Users\pmunts\ConsoleApplication\Properties\AssemblyInfo.pas
   Resource file: C:\Users\pmunts\AppData\Local\RemObjects Software\EBuild\Obj\ConsoleApplication-F312CC1DFED8B16B45057FBFB4E921119C4683B3\Release\Echoes\res\Properties-Resources.resources
   Reference: C:\Program Files (x86)\RemObjects Software\Elements\Echoes\Reference Assemblies\NETSTandard\Echoes.dll
   Reference: C:\Program Files (x86)\RemObjects Software\Elements\Echoes\Reference Assemblies\NETSTandard\Elements.dll
   Reference: C:\Users\pmunts\AppData\Local\RemObjects Software\EBuild\Packages\NuGet\hidsharp-2.0.5\lib\netstandard2.0\HidSharp.dll
   Reference: C:\Users\pmunts\AppData\Local\RemObjects Software\EBuild\Packages\NuGet\libremoteio-standard-1.0.6897.18860\lib\netstandard2.0\libremoteio-standard.dll
   Reference: C:\WINDOWS\assembly\GAC_MSIL\RemObjects.Elements.Cirrus\10.0.0.2347__3df3cad1b7aa5098\RemObjects.Elements.Cirrus.dll
   Reference: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll
   Solution 'ConsoleApplication' built successfully.

C:\Users\pmunts\ConsoleApplication>dotnet ConsoleApplication.exe
A JSON parsing exception occurred in [C:\Users\pmunts\ConsoleApplication\ConsoleApplication.deps.json]: Key not found
Error initializing the dependency resolver: An error occurred while parsing: C:\Users\pmunts\ConsoleApplication\ConsoleApplication.deps.json

I’ve uploaded the entire project, including the build artifacts but excluding the large .mdb and .pdb files:
ConsoleApplication.zip (324.8 KB)

I can’t see anything wrong with the deps file and I cannot for the life of me get dotnet to tell me what key it can’t find. At this point I’m stumped.

Addendum: Another oddity, that may or may not be relevant: The version of libremoteio-standard being refererenced is not the latest on nuget: Instead it is one build behind. The deps file references build 1.0.6897.18860 but the latest on NuGet is build 1.0.6915.28430, from one week ago.

My apologies for the delayed response, somehow this slipped by me. Having a look now.

Good news is, I can reproduce the issue.

selectively removing stuff from the Json, it seems the presence of any of these three blocks in the libraries section throws it off:

    "hidsharp/2.0.5": {
      "type": "package",
      "serviceable": false,
      "path": "hidsharp/2.0.5",
      "hashPath": "hidsharp.2.0.5.nupkg.sha512"
    },
    "libremoteio-standard/1.0.6915.28430": {
      "type": "package",
      "serviceable": false,
      "path": "libremoteio-standard/1.0.6915.28430",
      "hashPath": "libremoteio-standard.1.0.6915.28430.nupkg.sha512"
    },
    "Microsoft.NETCore.App/2.2.0": {
      "type": "package",
      "serviceable": true,
      "path": "microsoft.netcore.app/2.2.0",
      "hashPath": "/Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/NuGet/Microsoft.NETCore.App-2.2.0/microsoft.netcore.app.2.2.0.nupkg.sha512"
    }

but this one is fine:

    "ConsoleApplication/1.0.0": {
      "type": "project",
      "serviceable": false,
      "sha512": ""
    },

looks like its the lack of an

      "sha512": ""

entry that it doesn’t like. fixing…

Fixed. I can send you a new build in ~1-2h. Workaround unit then, manually add a sha512 item to the deps file after the build, like this:

ConsoleApplication.deps.json (1.9 KB)

Phil,

I’ve uploaded a new build to your Personal Downloads folder.

—marc

The new build works great. I can build a .Net Core app using NuGet package libremoteio-standard, and run it on Windows and Linux, including the Raspberry Pi.

2 Likes

Cool! glad to hear.