This repository was archived by the owner on Jan 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
How to migrate preview2 projects to rc3
Enrico Sada edited this page Feb 9, 2017
·
4 revisions
The dotnet-migrate
is the sdk tool to convert preview2
projects (project.json
/xproj
) to rc3
(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# (see diff)
- In
project.json
remove"compilerName": "fsc",
- Make sure the
dotnet-compile-fsc
version is"dotnet-compile-fsc":"1.0.0-preview2-*"
(1.0.0-preview2-020000
is ok too)
- In
- If multiple projects, repeat 1. for all project referenced (migrate will convert all referenced projects)
-
dotnet migrate
it!- Same bugs/limitations of C#, so report these to https://github.com/dotnet/cli/issues
- Rename the created
{yourproject}.csproj
in{yourproject}.fsproj
- Normalize C#
.csproj
as F#.fsproj
(see diff)-
Fix Sdk Attribute, adding prefix
FSharp.NET.Sdk;
like<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">
-
Add
FSharp.NET.Sdk
package (the F# msbuild integration)<ItemGroup> <PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-beta-*" PrivateAssets="All" /> </ItemGroup>
-
Set property
EnableDefaultCompileItems
tofalse
<PropertyGroup> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> <PropertyGroup>
-
- If multiple projects, fix
<ProjectReference
path from.csproj
to.fsproj
That's it. As usual now:
dotnet restore
-
dotnet build
ordotnet run
- Home
- Status
- FAQ
- Info-for-library-maintainers
- Current Stable (LTS) Version:
- Next Version (WIP):
- Previous Versions: