fsprojects / fsprojects/Paket

Paket does not support overwriting multiple settings in paket.reference

Open
#4,329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have the following bug with version 10.3.1:
I'm importing a reference which needs two properties overwritten: specific_version and embed_interop_types.
According to the documentation, I should be able to do that in paket.reference by defining the package twice for each setting (arguably, the documentation doesn't say that but the example implies it):

paket.reference (project-specific one, not inherited):

Microsoft.Office.Interop.Outlook specific_version: false
Microsoft.Office.Interop.Outlook embed_interop_types: true

However, when I run paket.exe install, the process goes through, but only sets the last setting in my .csproj:

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.8'">
      <ItemGroup>
        <Reference Include="Microsoft.Office.Interop.Outlook">
          <HintPath>..\..\..\packages\Microsoft.Office.Interop.Outlook\lib\net20\Microsoft.Office.Interop.Outlook.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
          <EmbedInteropTypes>True</EmbedInteropTypes>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

When I switch the lines in paket.reference (specific_version last), then only SpecificVersion is set and EmbedInteropTypes will NOT be set in .csproj.

In contrast (since it's not properly defined in the documentation except in the example code), if I try to set both settings in one line, paket.exe fails immediately.
Microsoft.Office.Interop.Outlook specific_version: false embed_interop_types: true will cause paket.exe to fail with an error.

Effectively, with 10.3.1 it is not possible to overwrite two settings in the paket.reference, despite the documentation having exactly this as an example:

Image

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

Reproduce the issue with the two Microsoft.Office.Interop.Outlook entries in paket.reference and run paket.exe install against the affected .csproj. Check how multiple settings for one reference are parsed and written; done means both SpecificVersion and EmbedInteropTypes appear in the generated project regardless of entry order, while the documented one-line form has defined behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.