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
In #1664, @saul added automatic generation of a main method. This breaks compilation for <OutputType>Exe</OutputType>, as it is generated even if there is already a main method. Compiling then gives the error
error FS0433: A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence.
I ran into this using MiniScaffold template. There, the Test app has a Main.fs, not a Program.fs .
Checking for a hard-coded filename seems like a too weak of a check, and I'd rather have no generation at all (and not have to find out about an obscure switch to turn this magic off.
Because of this magic, this took a really long time to find. Users can be expected to know that there should be a main method in exe programs.
The text was updated successfully, but these errors were encountered:
@rojepp at a minimum I think the compiler error should be improved (although that will be an issue for Microsoft/visualfsharp). The compiler error should log the file that is the last compile item - that would at least show you where to look.
It may also help if the auto-generated Program.fs had a comment explaining how to disable its generation.
Description
In #1664, @saul added automatic generation of a
main
method. This breaks compilation for<OutputType>Exe</OutputType>
, as it is generated even if there is already a main method. Compiling then gives the errorI ran into this using MiniScaffold template. There, the Test app has a
Main.fs
, not aProgram.fs
.Checking for a hard-coded filename seems like a too weak of a check, and I'd rather have no generation at all (and not have to find out about an obscure switch to turn this magic off.
Because of this magic, this took a really long time to find. Users can be expected to know that there should be a main method in exe programs.
The text was updated successfully, but these errors were encountered: