-
Notifications
You must be signed in to change notification settings - Fork 817
Emit a warning when referencing console applications exe's without a main #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
i think is the same problem as fsharp/fsharp#326 , the console project doesn't initialize see @latkin 's comment for detailed explaination and workaround @latkin @dsyme we need to add a warning? with c# you can reference the console app without problem, so is a bit unintuitive/annoying |
Yrs, an explicit Main is required, and this is currently considered by design, for better or worse. Adding a warning on referencing such a component may well be feasible. |
What's best?
|
#2 - emit an attribute or other bit when no main on .exe, and detect that when the component is referenced |
1 similar comment
#2 - emit an attribute or other bit when no main on .exe, and detect that when the component is referenced |
Create a solution with two Console Application projects:
ConsoleApplication1\Program.fs:
ConsoleApplication2\Program.fs (references ConsoleApplication1)
Expected output:
all good
Actual output:
SharedValue.hello is null!
needless to say, getting a null value from an F# project is quite surprising.
Changing the type of ConsoleApplication1 to a Library fixes this.
The text was updated successfully, but these errors were encountered: