Skip to content

MSBuild should have a directory import in Microsoft.Common.Targets #222

@Serivy

Description

@Serivy

My request is to be able to put enterprise level logic in a msbuild target at a solution level rather than modifying every single .*proj file. This way I can modify one file in the solution directory and all projects which implement Microsoft.Common.Targets can set things like $(OutDir), Reference Paths, Analyzers, Nuget restores/updates or even Build server logic (Strongname signing, digital signuates, assembly versions). It would be priceless to enforce logic on a solution without relying on developers to install the custom target file into the right directory. Currently I do this by modifying all the projects to import a solution wide target file.

There are more details on the uservoice page including other suggestions to change but it would essentially be adding <Import Project="$(SolutionDir)Custom.$(MSBuildThisFile)" Condition="$(SolutionDir)Custom.$(MSBuildThisFile)')"/> or some variation of this to Microsoft.Common.CurrentVersion.targets just under $(MSBuildProjectFullPath).user.

I created a user voice post previously but when I saw the news about MSBuild being open source I decided to raise it directly with you here. https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9674760-add-a-custom-solution-import-in-microsoft-common-t
I apologise for my persistence with this request however it would make maintaining an enterprise build system much easier.

I am happy to answer any queries you may have, especially if it strengthens the possibility of this becoming a reality! Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions