Open Youssef1313 opened 6 days ago
cc @YuliiaKovalova @JanKrivanek @rainersigwald
Ideas:
MSBuildXmlSchema
. Visual Studio (or dotnet/project-system?) evaluates the project, reads these items, and configures the XML editor. Would be controlled as part of build
or buildTransitive
in IncludeAssets and ExcludeAssets.
General problem: PackageReference conditional on TargetFramework. If the project is multitargeted and different target frameworks use different versions of the same package, then which version of the XML schema should be used by the XML editor?
General problem: if the VS user opens a file that is imported to multiple projects that reference packages that carry MSBuild XML schema files, how does VS choose the project whose package references should control the schemata in the XML editor?
General problem: if the VS user opens a file that is imported to multiple projects that reference packages that carry MSBuild XML schema files, how does VS choose the project whose package references should control the schemata in the XML editor?
Good question. I think that should be a merge of everything. In case of conflicts, it could show the property multiple times. For example, MyProperty (package ... version ...)
, then the tooltip for each of these can have the description from the specific package.
Summary
Today, csproj IntelliSense is only driven by XSDs provided by MSBuild. I think it would be nice to have some sort of extensibility and allow NuGet packages and/or custom MSBuild Sdks to provide their own XSD.
Background and Motivation
Many NuGet packages (regular ones and Sdks) offer some MSBuild properties intended for use by consumers. Today, first-party authors have to make the change in this repo, and third-party authors have no way to do it (assuming they don't go too crazy and grab the XSD from VS installation and attempt to modify it).
Proposed Feature
Not sure if the exact shape or technical limitations here, but having something like
Sdk.xsd
(like Sdk.props and Sdk.targets that are special cased for custom Sdks) would be nice. For regular NuGet packages, it could bebuild\<PackageName>.xsd
.Any other design that solves the problem is also good.
Alternative Designs
No response