theimowski / SuaveMusicStore

Sample application written in Suave.IO
https://www.gitbook.com/book/theimowski/suave-music-store
Apache License 2.0
71 stars 20 forks source link

Problems with target net461 on Linux #9

Open bratfizyk opened 6 years ago

bratfizyk commented 6 years ago

Hi Tomasz,

First thing - the tutorial looks great. Thanks for creating it. Well done ! I've got a problem running it: I follow the instructions for creating a project with VS Code, but hit a problem at a very beginning. After creating the "suave" project, I get the following error when I try to compile it:

error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.

(this occurs happens after using "./build.sh").

I believe this is because I'm missing the net461 target, which is used by the project by default. My configuration: mono (5.10.1.20), dotnet core (2.1.4), Linux Mint (18.3).

I solved this by substituting "net461" in SuaveMusicStore.fsproj with "netcoreapp2.0", but I guess I shouldn't need to do that and there's a better solution to make this work "out of the box".

Kind Regards, Arek

theimowski commented 6 years ago

Right, the bootstrapping section could probably benefit from using dotnet SDK, which seems to be the preferred way to go now. Not really sure why the above error - mono should be compatible with this version. Good you found a workaround for now - in longer run it could make sense to amend the bootstrapping section to use dotnet CLI

bratfizyk commented 6 years ago

should be compatible - well said ;). I'll keep on trying anyway, but preferred to let you know.

theimowski commented 6 years ago

Yep, thanks for reporting the issue

bratfizyk commented 6 years ago

More trouble: I've described it on StackOverflow: https://stackoverflow.com/questions/49971219/suave-with-netcoreapp2-0

For some reason the "browseHome" searches for the files in Suave nuget location, which is well... not something I'd like. Do you know if there's a walkaround ?

theimowski commented 6 years ago

does setting the homeFolder explicitly as suggested on SO help here?

bratfizyk commented 6 years ago

Sadly - no. I'll keep on trying though.

bratfizyk commented 6 years ago

Got some good news - I started a discussion on Slack in "dotnetcore" channel and there are people there who have already dealt with the problem.

I guess for the SuaveMusicStore the simplest option would be to use:

export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/

in the build.sh script. I added the line just before this one:

mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx

Then everything compiles out of the box (i.e. for "net461" target framework). As this belongs to the template that creates "suave" project, I guess in order to fix it, I should talk to the author of the template, right ? By any chance do you know who's that ?

theimowski commented 6 years ago

The templates are residing here: https://github.com/fsharp-editing/forge-templates In the long run I think people want to convert to dotnet templating engine, so ideally the tutorial could be updated to use dotnet new as well

wjkhappy14 commented 6 years ago

NDP461-DevPack-KB3105179-ENU.exe

wjkhappy14 commented 6 years ago

https://www.microsoft.com/en-us/download/details.aspx?id=49978

Microsoft .NET Framework 4.6.1 Developer Pack and Language Packs