This repository has been 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.json
remove"compilerName": "fsc",
- Make sure the
dotnet-compile-fsc
version is"dotnet-compile-fsc":"1.0.0-preview2-020000"
(NOTE not-*
but-020000
)
- In
-
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)-
Add
FSharp.NET.Sdk
package (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
.cs
files<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 restore
dotnet build
dotnet run
- Home
- Status
- FAQ
- Info-for-library-maintainers
- Current Stable (LTS) Version:
- Next Version (WIP):
- Previous Versions: