How to use calculated version(s) to pre-process files in the build?
See original GitHub issueIn my scenario I have a repo that contains some projects that represent NuGet packages with DLLs, plus some .NET CLI template packages that have projects that need to reference the build NuGet packages. Because the NuGet package versions are generated dynamically (thanks, NerdBank! 😄), I figured I need to use $(NuGetPackageVersion)
to process my template files and get that version injected into them.
I figure one strategy is to have a file such as templates\.template.config\template.json.in
(note the .in
extension) that has text REPLACE_VERSION
in it, then with an MSBuild target that runs at a suitable time, replace REPLACE_VERSION
with $(NuGetPackageVersion)
and save the file as templates\.template.config\template.json
, and let the build continue with the substituted values.
Does anyone know any guidance or sample of how to do this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
When I want to see what happened in MSBuild: http://www.msbuildlog.com/
This post is old but it seemed to match what I saw (I think): https://github.com/Microsoft/msbuild/issues/2890
I’m running .NET Core 3.0 and 3.1, but I’m not sure which I was using when I got the error.