Running a PreBuild target only once if multitarget #11479
Unanswered
AlexanderRydberg
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Heya!
Im all out of ideas. I need some help. Short story: I want to run a .exe from a nuget-package only once, before build, in a multitarget project. This is how I would usually do this for the projects that are not multitarget:
This is my test setup where I only do Message for debugging purposes:
This works except it is running for each of the target frameworks:
Result:
For it to run only once i can do this:
Result:
PkgMyNuget:
From what I understand, if Im running beforeTargets DispatchToInnerBuilds, then its running to early. So, here I am, asking for some help on how to solve this. Any suggestions?
Edit: I think I have found a workaround. But I would still like to see if theres any other approach to this problem since the package might not have been restored yet.
What I did not mention is that we are using CPM. The first property group I can have in
Directory.Packages.props
(and ofc skip the version in the csproj and have $(MyNugetVersion) on the version in .props)Beta Was this translation helpful? Give feedback.
All reactions