Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it on Directory.Build.props #83

Open
mr-j0nes opened this issue Feb 14, 2024 · 0 comments
Open

How to use it on Directory.Build.props #83

mr-j0nes opened this issue Feb 14, 2024 · 0 comments

Comments

@mr-j0nes
Copy link

mr-j0nes commented Feb 14, 2024

Hello there,

I just came across this package and I wonder how to use it. I am quite new to C#, Visual Studio, msbuild, etc.

I'd like to read a version.json file from Directory.Build.props so msbuild can assign the right version to all assemblies.

This package is the closest I found to achieving such task, but I am not sure how to do it. I have all above files in the root directory of my solution. I have added JSONPeek as a Nuget package to one of my Projects. My Directory.Build.props looks like this:

 <Project>
   <JsonPeek ContentPath="version.json" Query="$.version">
     <Output TaskParameter="Result" ItemName="Version" />
   </JsonPeek>
   <PropertyGroup>
     <Version>@(Version -> '%(version)')</Version>
   </PropertyGroup>
 </Project>

My problem is I am not sure how to reference the JSONPeek package. Also I am not 100% sure I am understanding whether this package is the right thing for what I need.

Could you help me and point me in the right direction?

Thanks in advance.

Back this issue
Back this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant