Skip to content

Custom Task and access to GeneratePathProperty create property from PackageReference element #8269

Discussion options

You must be logged in to vote

Does your custom task get items as parameters from a target, or does it use the MSBuild API to load and evaluate a second instance of the project? I'd normally expect the former, but the way you "retrieve all the evaluated properties out of the Project" makes me suspect the latter.

Are you trying to locate analyzer assemblies (including source generators) or reference assemblies?

In Microsoft.CSharp.Core.targets, the CoreCompile target passes References="@(ReferencePathWithRefAssemblies)" and Analyzers="@(Analyzer)" to the Csc task, so these include the DLLs from NuGet packages.

https://github.com/dotnet/roslyn/blob/15b43b33901c88f68ef43f8314b5a2457716780d/src/Compilers/Core/MSBuildTask/M…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ebfortin
Comment options

@KalleOlaviNiemitalo
Comment options

@ebfortin
Comment options

@ebfortin
Comment options

Answer selected by GangWang01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants