ProjectScaffold
ProjectScaffold copied to clipboard
Fix build of net4XXX target frameworks on mono
Description
When building a project generated from this repo on net46x/net47x, you get the infamous missing reference assemblies error:
/usr/share/dotnet/sdk/2.2.202/Microsoft.Common.CurrentVersion.targets(1183,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7" 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. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/home/me/Foo/tests/Foo.Tests/Foo.Tests.fsproj]
This can be fixed by setting the FrameworkPathOverride
to the matching mono base library directory, the logic of which is handily captured here. This file should be copied and added as an Import
include in the project files for the sample projects in this repo, like MiniScaffold does, to sidestep this very issue.