-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bending .NET - Corrected Common Flat Build Output #21
Comments
Hey @Stefan75, thank you very much for your comment. I actually saw the issue where someone (you?) commented on using <PropertyGroup>
<BeforeTargetFrameworkInferenceTargets>$(MSBuildThisFileDirectory)BeforeTargetFrameworkInference.targets</BeforeTargetFrameworkInferenceTargets>
</PropertyGroup> I just tried this out, and I believe it works! 🎉 I simply forward to and import the <Project>
<Import Project="$(MSBuildThisFileDirectory)\OutputBuildProject.props" />
</Project> I have attached a zip with this approach. Comments are welcome. F12 appears to work. Build looks same. Thanks! PS:
|
Hello,
@nietras
I read your blog post:
Blog Post
In the blog post you stated that you have to import in every cs project file a prop file:
Here the content of the
OutputBuildProjects.props
file:I guess the reason is that some of your properties depends on the settings of the cs-project file self.
(e.g. depends on
TargetFramework
)Maybe I found a solution, because I have a similar problem.
During my work I found the MS-Build Property
BeforeTargetFrameworkInferenceTargets
.It is possible to set the property to a msbuild-file which is then evaluated in a very early phase of the target-file evaulation, much earlier than the
Directory.Build.targets
file.Some parts of the
Direcotry.Build.props
file contentSome parts of the
BeforeTargetFrameworkInference.targets
file content:Here I used the
TargetFrmework
value for some debug outputs.Some remarks:
MSBuild Structured Logviewer
We want to use such a hook to define global defaults which depend on cs-projct-file content.
(e.g. OutptuType, ...)
With best regards,
stefan
PS: I hope my post helps.
The text was updated successfully, but these errors were encountered: