-
Notifications
You must be signed in to change notification settings - Fork 418
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
Intellisense Gets Broken in vscode if we have some derived properties from TFM #1738
Comments
This makes design-time build inconsistent with the actual build, which sets TargetFramework as a global property. The result is that Omnisharp's design time build is broken when actual build works fine. Omnisharp should use SetGlobalProperty instead to avoid this problem. /cc @DustinCampbell |
@ericstj thanks a lot. are there any side effects of this change that you are aware of? |
Not that I am aware of. Global properties have two different behaviors than the current code. 1: they apply to the entire project evaluation (the fix we want) 2: the flow to any child invocations of MSBuild from the project. 2 could potentially change things but given MSBuild already behaves this way on the command line I don’t expect it to be an issue. To test you can make sure to try a case where a project references another project and that project has different but compatible TargetFrameworks. Cc @rainersigwald |
thanks! |
In case of multple TargetFrameworks, omnisharp chooses the first target framework and do a reevaluation.
Before Re-evaluation, omnisharp uses
setproperty
function to set the TargetFramework property.omnisharp-roslyn/src/OmniSharp.MSBuild/ProjectLoader.cs
Line 151 in b442e6b
So this updates a property if it exists, otherwise it searches for the first unconditioned PropertyGroup in the project file to add the property to. This is always going to be after any implicit imports as well as explicitly leading imports. This appears to be the long-standing behavior of SetProperty. Contrast that to SetGlobalProperty, which will treat the property as global.
Hence any property derived from targetFramework in implicit imports and leading imports will not be evaluated correctly.
There is a detail repro here dotnet/runtime#33427 (comment)
The text was updated successfully, but these errors were encountered: