-
Notifications
You must be signed in to change notification settings - Fork 586
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
Error FS0039: The namespace or module 'Fake' is not defined. #2619
Comments
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project! |
@zelenij Ran into the same problem and resolved it by switching the framework for the paket.dependencies
build.fsx
Output with "netstandard2.0"
Output with "net6.0"
|
Thanks, I already figured the problem out. I was updating just fake-cli, while I needed to update the fake nuget packages as well. I think your approach forces the update, but I did it like that, also worked:
|
Neither of your solutions or a combination thereof worked for me. All I got was a different error instead.
At this point I'm considering ditching Fake completely. |
I don't have a stake in fake, and I also don't know how to help you. Your problem seem to be slightly different. Maybe try raising a new issue with full description, including your fake script? One thing I forgot to mention - I also upgraded my paket to the latest beta version. And try deleting the .fake directory before trying again. See if this helps... |
@kerams |
None, net6.0, netstandard2.1 result in the error above. netstandard2.0 results in the OP error. |
Async and task computation expressions are causing this. |
As @zelenij suggested, would create a new issue for this. I'm also not a Fake maintainer, just an active user. Came here to share how I resolved the OP issue, but yours seems to be something different. |
Is there any news or solutions? I didn't find a new issue with that but I've got exactly the same error right now. A few month ago this script works fine but now doesn't.
|
I remember getting the same error out of nowhere. I can't guarantee this will work, but it seems to, for me. First, upgrade every project you might have, that uses netstandard2.0 to 2.1. Second, use net6.0 (or 5.0) in Fake's paket section:
|
#2641 (comment) worked for me |
@zelenij Thanks, the following worked for me too:
|
It worked, update the packet, delete the lock file, run the command again to install. Thanks.
|
As a workaround[2] to what seems to be a FAKE bug[1]. [1] fsprojects/FAKE#2619 [2] fsprojects/FAKE#2619 (comment)
Update Paket restrictions by editing paket.dependencies changing frameworks to net6.0. And two additional things: 1) change netstandard2.0 to net6.0 as a workaround[2] to a FAKE bug[1]. 2) use 'strategy: min' to avoid dependencies be upgraded to versions that require net8.0 (e.g. Microsoft.Build.Framework 15.1.0.0 depending on FSharp.Core 8.0.0.0). [1] fsprojects/FAKE#2619 [2] fsprojects/FAKE#2619 (comment)
Update Paket restrictions by editing paket.dependencies changing frameworks to net6.0. And two additional things: 1) change netstandard2.0 to net6.0 as a workaround[2] to a FAKE bug[1]. 2) use 'strategy: min' to avoid dependencies be upgraded to versions that require net8.0 (e.g. Microsoft.Build.Framework 15.1.0.0 depending on FSharp.Core 8.0.0.0). [1] fsprojects/FAKE#2619 [2] fsprojects/FAKE#2619 (comment)
Update Paket restrictions by editing paket.dependencies changing frameworks to net6.0. And two additional things: 1) change netstandard2.0 to net6.0 as a workaround[2] to a FAKE bug[1]. 2) use 'strategy: min' to avoid dependencies be upgraded to versions that require net8.0 (e.g. Microsoft.Build.Framework 15.1.0.0 depending on FSharp.Core 8.0.0.0). [1] fsprojects/FAKE#2619 [2] fsprojects/FAKE#2619 (comment)
Description
Invoking the latest fake 5.21.0-alpha001 gives the following error:
Error FS0039: The namespace or module 'Fake' is not defined.
Worked fine with the previous version (which doesn't support .NET6)
Repro steps
The head of my build.fsx file looks like this
Expected behavior
Fake runs and executes correctly
Actual behavior
F# compilation errors are produced, as above
Known workarounds
Please provide a description of any known workarounds.
Related information
The text was updated successfully, but these errors were encountered: