You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
F# bundle the Program.fs (who contains the main, [<EntryPoint>] in f#), because a test project targeting netcoreapp2.0 is built as exe (so need a main)
But if i switch to net461, the test project is a library, by design, and should include it.
Atm template is going to be changed to conditionally include the Program.fs (ref dotnet/templating#1271 ) to workaround this.
But that's annoying, because all test framework templates need to do so. otherwise bug is subtle (ref dotnet/netcorecli-fsc#79 ).
C# autogenerate the Program.cs needed in the CoreGenerateProgramFile target.
F# should do the same.
Minor notes:
need to add the file at end (for f# file order matter, and EntryPoint MUST be the last), so just Compile is not enough (=> require support by f# sdk, like adding CompileLast or CompileMain item)
need a property to disable this behaviour. For example the expecto test library, used a lot in F#, configure itself in main, so cannot be autogenerated
something to generate the main empty file, obj/{projectName}.Program.fs (in F# sdk or msbuild sdk or here)
a feature flag (a property?), so project based on previous template (who add a Program.fs explicit) doesnt break with new sdk version
F# bundle the
Program.fs
(who contains the main,[<EntryPoint>]
in f#), because a test project targetingnetcoreapp2.0
is built as exe (so need a main)But if i switch to
net461
, the test project is a library, by design, and should include it.Atm template is going to be changed to conditionally include the
Program.fs
(ref dotnet/templating#1271 ) to workaround this.But that's annoying, because all test framework templates need to do so. otherwise bug is subtle (ref dotnet/netcorecli-fsc#79 ).
C# autogenerate the
Program.cs
needed in theCoreGenerateProgramFile
target.F# should do the same.
Minor notes:
EntryPoint
MUST be the last), so justCompile
is not enough (=> require support by f# sdk, like addingCompileLast
orCompileMain
item)obj/{projectName}.Program.fs
(in F# sdk or msbuild sdk or here)Program.fs
explicit) doesnt break with new sdk version/cc @dsyme @cartermp @KevinRansom
Environment
dotnet sdk >= 2.0
The text was updated successfully, but these errors were encountered: