-
Notifications
You must be signed in to change notification settings - Fork 25
How to migrate preview2 projects to rc4
The dotnet-migrate is the sdk tool to convert preview2 projects (project.json/xproj) to rc4 (fsproj, msbuild based)
It's invoked like dotnet migrate in the project directory
The dotnet-migrate doesnt support F# yet.
It's just not implemented yet, see dotnet/netcorecli-fsc#38
and up-for-grab (nice for new contributors) if someone want to fix that.
As workaround:
-
Normalize F# as C#
- In
project.jsonremove"compilerName": "fsc",
- In
-
If multiple projects, repeat 1. for all project referenced (migrate will convert all referenced projects)
-
dotnet migrateit!- Same bugs/limitations of C#, so report these to https://github.com/dotnet/cli/issues
-
Rename the created
{yourproject}.csprojin{yourproject}.fsproj -
Normalize C#
.csprojas F#.fsproj-
Fix Sdk Attribute, adding prefix
FSharp.NET.Sdk;like<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">
-
Remove
Microsoft.FSharp.Core.netcorePackageReference -
Add
FSharp.NET.Sdkpackage (the F# msbuild integration) andFSharp.Core<ItemGroup> <PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" /> <PackageReference Include="FSharp.Core" Version="4.1.*" /> </ItemGroup>
-
-
If multiple projects, fix
<ProjectReferencepath from.csprojto.fsproj
That's it. As usual now:
dotnet restore-
dotnet buildordotnet runordotnet test
- Home
- Status
- FAQ
- Info-for-library-maintainers
- Current Stable (LTS) Version:
- Next Version (WIP):
- Previous Versions: