Fire: mono with ebuild?

(JohnMoshakis) #1

Is it possible to build a mono app with ebuild ?

I added some nuget references to a mono console app and when building it says.

E: NuGet resolving is not supported for classic .NET project. Please set a ‘TargetFramework’.

I suppose Im asking if there is a target framework i could use ?


(marc hoffman) #2

Building a mono (“classic .net”) app should work fine (core compile; we don’t to auxiliary tasks such as resource processing yet build). It’s only the NuGet part that doesn’t work for Classic .NET projects yet.

What does Classic mean:

Classic means a .NET project like you would/could build with the current v9/xbuild-baed compiler. Right now, EBuild will use classic mode when there’s no TargetFramework set, and/or TargetFrameworkVersion is “vX”, such as “v4.6.2”. In this mode, we don’t support NuGet (yet?).

If instead you set a TargetFramework, such as “.NETCoreApp,Version=1.0”, “netcoreapp1.0” or even “net462”, you get the “new” mode — where NuGet is supported.

Note that in non-Classic mode, core references such as System.* and co will currently not resolve properly (mainly because for .NET Core there’s no such thing as core references, and that’s the only non-Classic submode i tested/focused on, so far ;).

BTW, would you be interested in pre-release access to the EBuild repository on GItHub (we’ll open it up eventually) - whether for reference/feedback only or even to contribute, ? if so, let me known your github account name…

“net462”, “.NET,Version=4.6.2” or just “net”, “.NET” would be there right TargetFramework for a “full .NET framework” project; but with the caveat from above that it prolly won’t resolve core refs property (yet).

(marc hoffman) #3

Actually, i’m wrong:

      case Target.Setting["SubMode"]:Value:ToLower of
        "net","classic": result := FindFullFrameworkReference(aReference);
        //else result := FindFullFrameworkReference(aReference); {$HINT Only for now!}

;). core ref resolving will work for “net” submode (it won’t for “corenetapp”, “netstandard” and others)

(JohnMoshakis) #4


My github is

(marc hoffman) #5

Invitation sent — feedback appreciated, on the overall structure and of invididual tasks.

all working for you now, w/ TargetFramework=net?

(JohnMoshakis) #6

Works with my 3 references

<NuGetReference Include="Akka:1.1.3" />
<NuGetReference Include="System.Collections.Immutable:1.1.36" />
<NuGetReference Include="Newtonsoft.Json:9.0.1" />

With a TargetFramework of “.Net” I get

-> Task RemObjects.EBuild.BuildSolution started.
Project: <RemObjects.EBuild.Elements.EBuildElementsProject: AkkaConsoleApplication>
-> Project AkkaConsoleApplication started.
-> Task RemObjects.EBuild.Elements.ElementsBuildProject started.
-> Task RemObjects.EBuild.Elements.ElementsCopyFinalOutput started.
-> Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutput started.
-> Task RemObjects.EBuild.Elements.ElementsLink started.
-> Task RemObjects.EBuild.Elements.ElementsCoreCompile started.
-> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started.
Preparing target ‘Echoes’ for platform ‘Echoes’.
-> Task RemObjects.EBuild.Elements.ElementsPrepareEchoesPlatform started for Echoes.
-> Task RemObjects.EBuild.Elements.ElementsPreflightEchoes started.
<- Task RemObjects.EBuild.Elements.ElementsPreflightEchoes finished, took 0.0192s (0.0202s).
W: Unkown or unsupported version of .NET ()
<- Task RemObjects.EBuild.Elements.ElementsPrepareEchoesPlatform finished, took 0.0075s (0.0298s).
<- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms finished, took 0.0372s (0.0373s).
-> Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings started for Echoes.
<- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings finished, took 0.0004s (0.0005s).
-> Task RemObjects.EBuild.Elements.ElementsResolveReferences started.
– Task RemObjects.EBuild.Elements.ElementsPreparePlatforms skipped, already ran.
-> Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences started.
<- Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences finished, took 0.0019s (0.0023s).
-> Task RemObjects.EBuild.Elements.ElementsResolveEchoesReferencesForTarget started for Echoes.
-> Task RemObjects.EBuild.Elements.ElementsProcessNuGetReferences started for Echoes.
E: Object reference not set to an instance of an object
<- Task RemObjects.EBuild.Elements.ElementsProcessNuGetReferences failed with exception Object reference not set to an instance of an object, took 0.0000s (0.0282s).
<- Task RemObjects.EBuild.Elements.ElementsResolveEchoesReferencesForTarget failed, took 0.0041s (0.0333s).
<- Task RemObjects.EBuild.Elements.ElementsResolveReferences failed, took 0.0340s (0.0374s).
<- Task RemObjects.EBuild.Elements.ElementsCoreCompile failed, took 0.0000s (0.0773s).
<- Task RemObjects.EBuild.Elements.ElementsLink failed, took 0.0000s (0.0777s).
<- Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutput failed, took 0.0000s (0.0781s).
<- Task RemObjects.EBuild.Elements.ElementsCopyFinalOutput failed, took 0.0000s (0.0786s).
<- Task RemObjects.EBuild.Elements.ElementsBuildProject failed, took 0.0000s (0.0793s).
<- Project AkkaConsoleApplication failed, took 0.0797s.
<- Task RemObjects.EBuild.BuildSolution failed, took 0.1024s (0.1040s).

(JohnMoshakis) #7

I also removed every other reference and it built. ie all the System.* and co

Is that to be expected ?

It also doesnt copy references to the bin folder but if I copy them myself it runs :slight_smile:

(marc hoffman) #8

Hmm, i’m guessing i don’t set a default yet. will check into that.

NuGet stuff doesn’t get copy-local’ed yet, no. i’ll need in investigate big that works (i.e. how to determine what needs CopyLocal and what doesn’t — i don’t recall seeing any flags to that regard in the Nuget package metadata, afaict.

sort of. mscorlib.dll will be referenced automatically if missing. If yo don’t use anything outside of it, you can be good without any other references. But you should not be able to access stuff thats in System,dll or ny off the others, of course. If you can, thats weird and id love to see a test case.

(marc hoffman) #9

ps, the code for this is in PreparePlatform.Echoes.pas, if you’re curious.