fsprojects / fsprojects/Paket

Add `frameworkReference`

Open
#3,856 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

Is it possible to include frameworkReferences (e.g. to Microsoft.AspNetCore.App) when packing an application?
I'm creating a library that internally starts a self-hosted ASP.NET core server. With .NET Core 3 it seems you either should use Microsoft.NET.Sdk.Web or add a frameworkReference to Microsoft.AspNetCore.App (either in the project file or in the .nuspec file). dotnet pack doesn't work when using Microsoft.NET.Sdk.Web (disables packaging), but dotnet packing is possible when using frameworkReference (the information is included in the .nupkg). However Paket doesn't include any information about frameworkReferences when packing the library.

Repro steps
  1. Create a new project and replace *.fsproj with the following:

    <Project Sdk="Microsoft.NET.Sdk">
    
    <PropertyGroup>
      <TargetFramework>netcoreapp3.0</TargetFramework>
      <OutputType>dll</OutputType>
    </PropertyGroup>
    
    <ItemGroup>
      <FrameworkReference Include="Microsoft.AspNetCore.App" />
    </ItemGroup>
    
    <ItemGroup>
      <Compile Include="Program.fs" />
    </ItemGroup>
    
    <Import Project=".paket\Paket.Restore.targets" />
    </Project>
    
  2. Pack the application with dotnet pack and paket pack

  3. Open the package with Nuget Package Explorer and find that dotnet pack includes the frameworkReference and paket pack does not.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied project file and its .paket\Paket.Restore.targets import, then reproduce the difference between dotnet pack and paket pack. Inspect the generated packages and use the listed FrameworkReference entry as the expected input; done means Paket's package includes the corresponding frameworkReference information.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.