Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.
This repository was archived by the owner on Jan 8, 2019. It is now read-only.

None MSBuild items added for .fs files when compiling #94

@mrward

Description

@mrward

If you compile a F# console project you see None items added for each .fs file in the project.

To reproduce:

.NET SDK 1.0.1 installed.

  1. dotnet new console -lang F#
  2. dotnet restore
  3. dotnet build /v:diag > build.log

If you look in the build.log you see a None and a Compile item for Program.fs:

                   Compile
                       Program.fs
                   DebugSymbolsProjectOutputGroupOutput
                      ~/Projects/Tests/dotnet/bar/obj/Debug/netcoreapp1.1/bar.pdb
                           FinalOutputPath = ~/Tests/dotnet/bar/bin/Debug/netcoreapp1.1/bar.pdb
                           TargetPath = bar.pdb
                   DeployManifest
                       obj/Debug/netcoreapp1.1/bar.application
                           TargetPath = bar.application
                   IntermediateAssembly
                       obj/Debug/netcoreapp1.1/bar.dll
                   None
                       Program.fs

If you edit the .fsproj file and add <EnableDefaultItems>false</EnableDefaultItems> the None items are not added.

The FSharp.NET.Sdk 1.0.1 NuGet package has the following in its FSharp.NET.Sdk.props:

<EnableDefaultCompileItems>false</EnableDefaultCompileItems>

So maybe this should also have EnableDefaultItems set to false. Not sure if EnableDefaultEmbeddedResourceItems and EnableDefaultNoneItems need to be set to false. It looks like just setting EnableDefaultItems to false would fix the problem.

In general this does not seem to break anything. The build still works. I only noticed it with recent VS for Mac builds since VS for Mac is now using the SDK imports to determine the files that should be displayed in the Solution window and I was seeing duplicate files. The duplicate files in VS for Mac was not caused by this, since due to another bug it is using resolved MSBuild items ignoring the conditions, but I whilst debugging I ran across this and initially thought it was the cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions