Skip to content

Keep @(Reference) metadata when creating @(ProjectReference) items #21567

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

Merged
merged 2 commits into from
Aug 4, 2020

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented May 7, 2020

Projects of particular interest:

  • src/DefaultBuilder/src/Microsoft.AspNetCore.csproj
    • honouring metadata left e.g. Microsoft.AspNetCore.Components.WebAssembly.DevServer package unchanged
    • removed redundant metadata after that confirmation
  • src/Razor/tools/Microsoft.AspNetCore.Razor.Internal.Transport/
    • content of this package unchanged but metadata avoids extra work
    • add a comment about the extra work
  • src/SiteExtensions/LoggingAggregate/src/Microsoft.AspNetCore.AzureAppServices.SiteExtension/
    • success! removes Microsoft.Web.Xdt.Extensions dependency from the package
  • src/SiteExtensions/Runtime/Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj
    • add a Condition to avoid an ordering issue I hit here
  • src/Tools/Extensions.ApiDescription.Server/src/
    • avoid errors the new build ordering and timing caused

Separately, up the timeout in the <DownloadFile /> task

  • hit repeated timeouts downloading dotnet-runtime-5.0.0-rc.1.20370.4-win-x64.zip

nits:

  • remove dupe @(Reference) item in Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj
  • remove useless %(ProjectReference.IsImplicitlyDefined) metadata as well as its misspellings
  • remove extra spaces from ProjectReferences.props
  • clean up a few comments in ResolveReferences.targets

@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label May 7, 2020
@dougbu dougbu force-pushed the dougbu/site.extensions.20818 branch from e9e81db to b875f2a Compare May 7, 2020 16:57
@dougbu dougbu force-pushed the dougbu/site.extensions.20818 branch from b875f2a to 95dc49a Compare July 30, 2020 04:29
@dougbu dougbu changed the title Move @(Reference) -> @(ProjectReference) conversion into a target Keep @(Reference) metadata when creating @(ProjectReference) items Jul 30, 2020
@dougbu dougbu force-pushed the dougbu/site.extensions.20818 branch from 95dc49a to f5507b5 Compare July 31, 2020 21:01
@dougbu
Copy link
Contributor Author

dougbu commented Jul 31, 2020

Also building in https://dev.azure.com/dnceng/internal/_build/results?buildId=753395 to create the Microsoft.AspNetCore.AzureAppServices.SiteExtension package.

- #20818, fix e.g. references to Microsoft.Web.Xdt.Extensions in our packages
- make `@(Reference)` items much more broadly applicable
- emit an error when `@(ProjectReference)` is used instead of `@(Reference)`
    - then get rid of the errors (!!)
- rename a couple of projects to match their assembly names
    - then regenerate the `@(ProjectReferenceProvider)` items
- switch intersection approach from Exclude / Exclude to Copy / Update / Copy

Projects of particular interest:
- src/DefaultBuilder/src/Microsoft.AspNetCore.csproj
    - honouring metadata left e.g. Microsoft.AspNetCore.Components.WebAssembly.DevServer package unchanged
    - removed redundant metadata after that confirmation
- src/Razor/tools/Microsoft.AspNetCore.Razor.Internal.Transport/
    - content of this package unchanged but metadata avoids extra work
    - add a comment about the extra work
- src/SiteExtensions/LoggingAggregate/src/Microsoft.AspNetCore.AzureAppServices.SiteExtension/
    - success! removes Microsoft.Web.Xdt.Extensions dependency from the package
- src/SiteExtensions/Runtime/Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj
    - add a `Condition` to avoid an ordering issue I hit here
- src/Tools/Extensions.ApiDescription.Server/src/
    - avoid errors the new build ordering and timing caused

Separately, up the timeout in the `<DownloadFile />` task
- hit repeated timeouts downloading dotnet-runtime-5.0.0-rc.1.20370.4-win-x64.zip

nits:
- remove dupe `@(Reference)` item in Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj
- remove useless `%(ProjectReference.IsImplicitlyDefined)` metadata as well as its misspellings
- remove extra spaces from ProjectReferences.props
- clean up a few comments in ResolveReferences.targets

questions about current `@(PackageReference)` items:
- why does Internal.AspNetCore.Analyzers project use Microsoft.CodeAnalysis.CSharp.Workspaces v2.8.0?
- should we move from Yarn.MSBuild 1.15.2 to 1.22.4 i.e. `yarn` 1.13.0 to 1.22.4?
- should `AddContent` target in Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj instead get 5.0 packages?
- should we move `MsQuicPackage.*` version from QuicSampleClient and QuicSampleApp projects to eng/Versions.props?
@dougbu dougbu force-pushed the dougbu/site.extensions.20818 branch from f5507b5 to bc3bad0 Compare August 3, 2020 03:53
@dougbu
Copy link
Contributor Author

dougbu commented Aug 3, 2020

@dougbu dougbu marked this pull request as ready for review August 3, 2020 22:01
@dougbu dougbu requested a review from a team August 3, 2020 22:01
@dougbu
Copy link
Contributor Author

dougbu commented Aug 3, 2020

I have double-checked the packages for updated projects and found no differences other than the expected assembly file versions and the #20818 fix. This PR is ready for review.

@dougbu
Copy link
Contributor Author

dougbu commented Aug 3, 2020

questions about current @(PackageReference) items:

  • why does Internal.AspNetCore.Analyzers project use Microsoft.CodeAnalysis.CSharp.Workspaces v2.8.0?
  • should we move from Yarn.MSBuild 1.15.2 to 1.22.4 i.e. yarn 1.13.0 to 1.22.4?
  • should AddContent target in Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj instead get 5.0 packages?
  • should we move MsQuicPackage.* version from QuicSampleClient and QuicSampleApp projects to eng/Versions.props?

@jkotalik
Copy link
Contributor

jkotalik commented Aug 3, 2020

MsQuicPackage.*

Sure.

@pranavkm
Copy link
Contributor

pranavkm commented Aug 3, 2020

why does Internal.AspNetCore.Analyzers project use Microsoft.CodeAnalysis.CSharp.Workspaces v2.8.0

I'm not really familiar with that package. @JunTaoLuo would know best

@BrennanConroy
Copy link
Member

* should `AddContent` target in Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj instead get 5.0 packages?

I'm not really sure what that part is for, but it does look like we should probably update the version.

* should we move from Yarn.MSBuild 1.15.2 to 1.22.4 i.e. `yarn` 1.13.0 to 1.22.4?

No objections here.

<!-- Use only Reference items when project is a reference provider. Simplifies project moves and shortens files. -->
<_AllProjectReference Update="@(ProjectReference->'%(Filename)')" DirectUse="1" />

<_AllProjectReference Update="@(Reference)" Use="1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a guarantee we'll never need to update this list of metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few guarantees in life😈 But, the current list goes pretty far beyond what we're likely to use in *.csproj and *.fsproj projects and should hold us in good stead until and unless new metadata is invented. I included everything I saw used in existing @(Reference) and @(ProjectReference) items in this repo as well as what seemed plausible from the documentation.

Copy link
Member

@wtgodbe wtgodbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like goodness

@dougbu dougbu merged commit e133683 into master Aug 4, 2020
@dougbu dougbu deleted the dougbu/site.extensions.20818 branch August 4, 2020 17:05
@dougbu
Copy link
Contributor Author

dougbu commented Aug 4, 2020

I'll file an issue about the changes we could or should make based on the answers to my questions above once we hear from @JunTaoLuo.

@JunTaoLuo
Copy link
Contributor

FYI, after our offline discussion, we're going to try updating the TFM of Internal.AspNetCore.Analyzers to target netstandard2.0 TFM so it can consume the same version of the roslyn packages as the rest of the repo. Also good to double check if we plan on removing this package outright at some point.

@dougbu
Copy link
Contributor Author

dougbu commented Aug 5, 2020

@pranavkm following up on @JunTaoLuo's comment just above

Also good to double check if we plan on removing this package outright at some point.

I'm double-checking😺 I couldn't find a seemingly-relevant issue about removing the analyzer but also can't find anywhere we're suppressing it other than for analyzers and tools. Do we need this anymore❔

And, if we need it, why is it packaged i.e. is the package just a holdover from when the project was in dotnet/extensions❔

@pranavkm
Copy link
Contributor

pranavkm commented Aug 5, 2020

And, if we need it, why is it packaged i.e. is the package just a holdover from when the project was in dotnet/extensions❔

That seems like the most likely scenario.

I couldn't find a seemingly-relevant issue about removing the analyzer

I think I commented on this in another issue. There's only one analyzer in the package about not exposing pubternal types. We don't have any of those any more so it seems entirely unnecessary.

@dougbu dougbu mentioned this pull request Aug 6, 2020
4 tasks
@dougbu
Copy link
Contributor Author

dougbu commented Aug 6, 2020

#24608 covers the follow-up points above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants