开发者

How to include current package version in NuGet transformation files?

开发者 https://www.devze.com 2023-03-31 11:44 出处:网络
I would like to include a content file into the package that should refer to the current version of the package being installed (more precisely to the package folder, but the only varying part is the

I would like to include a content file into the package that should refer to the current version of the package being installed (more precisely to the package folder, but the only varying part is the version).

Is there a special syntax (e.g. $packageversion$ - does not work) to include the version number into a transformed (.pp) content file?

Alternative: I can access the version from the install.ps1 and I can also invoke Add-Content (i suppose that wi开发者_运维技巧ll also apply the transformations), but how can I extend the replacement placeholders?


The variables you can use (like $rootnamespace$) are the ProjectProperties so you won't be able to access the version number.

As a workaround, you could try naming the file as part of your build step that creates the NuGet package.

If you think it'd be good to see this added to NuGet, it's worth starting a discussion on the NuGet site, the developers are pretty active there :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消