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 25
How to migrate preview2 projects to preview3
Enrico Sada edited this page Nov 17, 2016
·
3 revisions
The dotnet-migrate is the sdk tool to convert preview2 projects (project.json/xproj) to preview3 (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. It's up-for-grab (nice for new contributors) if someone want to fix that.
As workaround:
- Normalize F# as C# (see diff)
- In
project.jsonremove"compilerName": "fsc", - Make sure the
dotnet-compile-fscversion is"dotnet-compile-fsc":"1.0.0-preview2-020000"(NOTE not-*but-020000)
- In
-
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(see diff)-
Add
FSharp.NET.Sdkpackage (the F# msbuild integration)<ItemGroup> <PackageReference Include="FSharp.NET.Sdk"> <Version>1.0.0-alpha-*</Version> <PrivateAssets>All</PrivateAssets> </PackageReference> </ItemGroup>
-
Remove the wildcard include of
.csfiles<Compile Include="**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
-
Replace
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
with
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
-
That's it. As usual now:
dotnet restoredotnet builddotnet run
- Home
- Status
- FAQ
- Info-for-library-maintainers
- Current Stable (LTS) Version:
- Next Version (WIP):
- Previous Versions: