Skip to content

Paket can't find build configurations specified with dynamic OutputPath node #914

Closed

Description

@allykzam

When processing a project file using <OutputPath>bin\$(Configuration)\</OutputPath> in the main <PropertyGroup> node, running paket pack output "bin" results in:

Paket failed with:
Unable to find Release output path node in file C:\File\Path\Here\Project.fsproj

I'd try to jump in and work on some changes to fix this myself, but I'm not sure how the paket people feel this should be resolved.

Activity

  1. forki commented on Jul 19, 2015

    @forki
    Member

    Not really sure I understand the issue.

    /cc @mavnn

  2. allykzam commented on Jul 19, 2015

    @allykzam
    ContributorAuthor

    In a typical project file, Visual Studio builds little sections of XML for each build configuration — Debug|AnyCPU, Debug|x86, Release|AnyCPU, etc. — and adds values that are considered specific to each configuration. One of these is an OutputPath value, which indicates where the compiled binaries are put. When compiling a project, MSBuild goes through the project file and process each value, dynamically resolving placeholders like $(Configuration) to the appropriate value. So rather than providing an OutputPath node for each build configuration, if you were writing a project file by hand, you could write a single node like <OutputPath>bin\$(Configuration)\</OutputPath> in the section of the project file that applies globally, and MSBuild would dynamically resolve that to bin\Release\, bin\Debug\, etc. as needed.

    With a project file that only has one OutputPath node configured as above, paket pack commands refuse to run, giving the output I mentioned before. I assume this is because either paket is looking for an OutputPath within the block of XML specific to the current build configuration and can't find it, or because paket found the OutputPath but isn't processing the placeholder and can't find a folder named bin\$(Configuration)\.

  3. forki commented on Jul 23, 2015

    @forki
    Member
  4. allykzam commented on Jul 23, 2015

    @allykzam
    ContributorAuthor

    Not quickly/easily; my only useful thought is to process every node in the project file, loading each value into a dictionary, and process the placeholders like MSBuild does. Realistically, doing that exactly how MSBuild does it means also processing external .targets files as well; hence my concern about how you feel like resolving this. Ignoring external .targets files would be fine for my current use-case, but would still preclude potential valid project files from being used.

  5. forki commented on Jul 23, 2015

    @forki
    Member

    Mhm, if you send a PR which solves your use case that would still be an improvement...

  6. allykzam commented on Jul 23, 2015

    @allykzam
    ContributorAuthor

    Alright, I'll see if I can work up something useful this weekend. :)

  7. allykzam commented on Jul 25, 2015

    @allykzam
    ContributorAuthor

    I have the start of an implementation at amazingant/features/handle-dynamic-outputpath if you want to take a look. I haven't touched handling placeholders or conditions yet, but if the route I'm going is entirely unappealing to you, it should be apparent already.

  8. forki commented on Jul 25, 2015

    @forki
    Member

    could you please create a WIP Pull Request for easier discussion? thx

  9. allykzam commented on Aug 24, 2015

    @allykzam
    ContributorAuthor

    Resolved with #942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions