Skip to content

Documenting .NET Core MSBuild targets and properties/CSPROJ #2642

Closed

Description

@guardrex

This has been coming up more and more as we go. There have been numerous requests for help on Slack chat, several on SO, and a question on the Standup: https://youtu.be/c9Ub4uwjlbo?list=PL0M0zPgJ3HSftTAAHttA3JQU4vOjXFquF&t=3677.

@mairaw mentioned to me on Slack that props and targets perhaps are best explained as part of a topic that addresses .NET Core-specific csproj generally ... not so much just "targets and properties" disconnected from the project file.

Current info can be found in the tutorials and topics such as A mapping between project.json and csproj properties, Additions to the csproj format for .NET Core, and Packages, Metapackages and Frameworks. What's been happening quite a bit I think is that devs end up digging around in ...

https://github.com/dotnet/sdk/tree/master/src/Tasks/Microsoft.NET.Build.Tasks/targets

... to find useful/helpful props and targets. I think we all agree that that's not a good UE.

This issue addresses the need to have a clearly-visible topic for the project file that isn't migration-based, perhaps with a companion reference topic on only targets and properties in a tables format. Those could pertain to sdk, websdk, or both; but I suggest getting the websdk bits covered somewhere clearly visible in addition to merely covering the sdk ones.

cc/ @dasMulli ... Who has helped hundreds of devs with props/targets for .NET Core. I hope he'll make some observations for this issue.

Activity

  1. BillWagner commented on Jul 17, 2017

    @BillWagner
    Member

    Related to this topic we should provide guidance for how to configure client side builds (npm, grunt, gulp tasks) for CI builds.

  2. added this to the milestone on Jul 17, 2017
  3. dasMulli commented on Jul 31, 2017

    @dasMulli
    Contributor

    There are likely at least two distinct concerns here:

    1. Things to use for configuring properties and items that the SDK / build targets will understand.
      e.g. things like CopyLocalLockFileAssemblies, RuntimeFrameworkVersion.
    2. Things available in custom targets and when they will be available (=> knowing what to put in AfterTargets / DependsOnTargets).
      e.g. OutputPath, DocumentationFile etc.
      This might also include common items and which target generates them.. for example, knowing that depending on ResolvePackageDependenciesForBuild enables accessing @(PackageDefinitions) and @(PackageDependencies) items, which allowed me to create a reverse dependency list.
  4. nguerrera commented on Aug 31, 2017

    @nguerrera

    As part of this, the documentation for BaseIntermediateOutputPath needs to indicate that it must not be set in the body of a <Project Sdk="Microsoft.NET.Sdk">. See dotnet/sdk#1518 (comment)

  5. modified the milestones: , on Sep 11, 2017
  6. guardrex commented on Sep 13, 2017

    @guardrex
    ContributorAuthor

    Cross ref (might be good to include something on <RunWorkingDirectory>): https://github.com/aspnet/websdk/issues/238

  7. dougbu commented on Oct 23, 2017

    @dougbu

    Please include information about breaking changes affecting project files after migration from the "old style". Hit the breaking change described at https://github.com/dotnet/project-system/blob/master/docs/configurations.md over the weekend and didn't find that page 'til @natemcmaster told me about it. Need something better than tribal knowledge here…

  8. modified the milestones: , on Jan 8, 2018
  9. Zastai commented on Jan 12, 2018

    @Zastai
    Contributor

    Please also document all properties that have special meaning for the compiler etc.
    I was bitten by setting an Instrument property, which apparently triggers the use of an undocumented C# compiler option (at least it's not listed here).
    I'm not sure it makes sense to impact the user namespace like that; such flags could/should be named something like CscInstrument/C#.Instrument/Csc:Instrument.

  10. mairaw commented on Jan 22, 2018

    @mairaw
    Contributor

    From @proog:
    "The csproj reference topic lists the two main SDKs that can be specified in the Sdk attribute of a element.

    While it does have a vague mention of the SDK being a "set of tasks and targets," it does not explain which, and perhaps more importantly does not explain what the consequences of choosing one over the other is.

    In my opinion it would be helpful to have a paragraph dedicated to choosing the right SDK, or a reference to a more in-depth explanation of their differences."

  11. 66 remaining items

  12. mairaw commented on Jan 6, 2020

    @mairaw
    Contributor

    Assigning this to @gewarren. Feel free to break this task into smaller issues if it helps or schedule a meeting for us to go over the details.

  13. ghogen commented on Jan 24, 2020

    @ghogen
    Contributor

    As of Jan 2020, I own MSBuild docs, so I will be looking at similar issues in the coming weeks. @gewarren

  14. added and removed on Mar 5, 2020
  15. removed this from the March 2020 milestone on Mar 30, 2020
  16. gewarren commented on Apr 25, 2020

    @gewarren
    Collaborator

    Add info about the degree to which the .NET Core SDK supports existing project files (not SDK style).

  17. dasMulli commented on Apr 27, 2020

    @dasMulli
    Contributor

    Add info about the degree to which the .NET Core SDK supports existing project files (not SDK style).

    I believe the communication from the SDK/CLI team over the years was along the lines of "not officially supported, it may work for you and only you".
    Would be good to have that somewhere as some GH issues have been raised in the past, especially during 1.0-2.0 time (not sure if there were many recently).

  18. gewarren commented on Apr 30, 2020

    @gewarren
    Collaborator

    I've created manageable chunk issues to track the remaining work on https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props. Closing this one out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions