You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)\.
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.
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.
Activity
forki commentedon Jul 19, 2015
Not really sure I understand the issue.
/cc @mavnn
allykzam commentedon Jul 19, 2015
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 anOutputPathvalue, 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 anOutputPathnode 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 tobin\Release\,bin\Debug\, etc. as needed.With a project file that only has one
OutputPathnode configured as above,paket packcommands refuse to run, giving the output I mentioned before. I assume this is because either paket is looking for anOutputPathwithin the block of XML specific to the current build configuration and can't find it, or because paket found theOutputPathbut isn't processing the placeholder and can't find a folder namedbin\$(Configuration)\.forki commentedon Jul 23, 2015
any ideas to fix this in https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/ProjectFile.fs#L585 ?
allykzam commentedon Jul 23, 2015
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
.targetsfiles as well; hence my concern about how you feel like resolving this. Ignoring external.targetsfiles would be fine for my current use-case, but would still preclude potential valid project files from being used.forki commentedon Jul 23, 2015
Mhm, if you send a PR which solves your use case that would still be an improvement...
allykzam commentedon Jul 23, 2015
Alright, I'll see if I can work up something useful this weekend. :)
allykzam commentedon Jul 25, 2015
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.
forki commentedon Jul 25, 2015
could you please create a WIP Pull Request for easier discussion? thx
allykzam commentedon Aug 24, 2015
Resolved with #942