-
Notifications
You must be signed in to change notification settings - Fork 33
Update MSBuildEvaluationContext to use IntrinsicFunctions from Microsoft.Build.dll #77
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
Conversation
I've not managed to retain the |
a recent version of IntrinsicFunctions would be here: https://github.com/dotnet/msbuild/blob/main/src/Build/Evaluation/IntrinsicFunctions.cs what you are doing is link a call of type IntrinsicFunctions to msbuild-functions |
Looking at the history of the MonoDevelop InstrinsicFunctions (https://github.com/dotdevelop/dotdevelop/commits/main/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IntrinsicFunctions.cs) they were re-imported from MSBuild with a commit on Sep 22 2017 and remained unchanged until an extra function I've added a block comment to the header of the The only other approach to caching at runtime would be to re-import the current The |
i remember something like: |
Yes, you remember correctly (I spent a lot of time and debugging to get to the same understanding!). But in
so this function is detected specifically. I need to have a think about what the implications are in this case, so perhaps including "Copy" as an IntrinsicFunction in the local code is necessary? However, it will fail to get found in the |
https://github.com/dotnet/msbuild/blob/main/src/Build/Evaluation/IntrinsicFunctions.cs
so, lets look to the documentation: https://docs.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2022 |
So, |
As far as I can see, |
i guess it's a performance workaround:
and dotnet/msbuild/issues/4615 has a performance label |
I've added another commit to this PR which removes the special case of String.Copy in |
Although this PR is necessary in order to progress to handling |
7351edd
to
a51afa1
Compare
I've just updated the fix_Issue_75 branch to completely remove the local implementation of IntrinsicFunctions (see commit a51afa1 above) and squashed the previous commits to make life easier. @lytico Further to my last comment, I think this PR could be merged now, as I don't think the remaining net5ff bugs can be tackled unless a project's properties are first evaluated correctly. However, might it be useful to create a |
and update MSBuildEvaluationContext.cs accordingly IntrinsicFunctions are now loaded at runtime from the current version of Microsoft.Build.dll, as identified by the active runtime. The old IntrinsicFunctions test is no longer meaningful and has been removed This fixes Issue dotdevelop#75 so that all project properties are now evaluated correctly.
a51afa1
to
7045264
Compare
@hwthomas +1 for the dev or testing branch, this is a convential way of working in most companies anyway and it would allow us to create pre-release builds next to release builds, should we ever set that up in the pipelines. |
Incorporate changes in PR#81 from @gluckez to fix conflicts
Merged as part of PR #96 |
This fixes Issue 75
The existing code for
IntrinsicFunctions
(inmain/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild
) is a local implementation of the functions in Microsoft.Build, but is now very much out-of-date, and many of the functions which are used to evaluate newer project properties are not implemented.It is referenced preferentially during the property evaluations (rather than the Microsoft.Build.dll referenced in the csproj file), and this causes the property evaluations to fail. Updating the code so that the Dictionary
cachedIntrinsicFunctions
is created dynamically at runtime from the currentMicrosoft.Build.dll
fixes the problem, and all project properties now evaluate correctly.