I just watched a bunch of WDC videos on F# and decided to give it a go. I downloaded a fresh offline install of Visual Studio 2022 and put it on my lab computer. I fired up a first Hello World app, and it does not compile. I tried googling the error to lots of answers for computers with an online connection.
Does anyone have a good getting started guide to setting up an offline lab for F#?
// Learn more about F# at http://fsharp.org
open System
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
0 // return an integer exit code
This is the error
Severity Code Description Project File Line Suppression State
Error NETSDK1004 Assets file 'C:\Users\OfflineLab\source\repos\ConsoleApp3\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. ConsoleApp3 C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 267
Rerun the Visual Studio installer and modify the installation. Under the installation details for .NET Desktop Development make sure âF# desktop language supportâ is ticked as youâre trying to make a desktop/console type project. I suspect that will help as I always create and build a console app after every VS install with no problems unless I missed that step.
Iâve tried asking the VS team to enable this by default but they wonât for âreasonsâ. But they should so that people like you donât have issues when they go to try out F#.