dotnet / dotnet/msbuild

Schema: TargetOrImportType causes validation failures in otherwise fine .csproj files

Open
#8,486 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 6h
Merged PRs (30d)
139

Description

https://github.com/dotnet/msbuild/blob/f93b24b5a88a37a3b6b122c7f65f910fcc2ba2f0/src/MSBuild/MSBuild/Microsoft.Build.Core.xsd#L12

![image](https://user-images.githubusercontent.com/15258962/220757906-d18671f0-fed9-4b27-9d9a-af2f635b2c76.png)

Adding a `` or `` removes the warning, but these are not required for most .csproj files, so this should be marked as an optional in the sequence.

## Reproduce
VSCode w/ XML extension

Sample simple .csproj generated with `dotnet new classlib`
```xml


net7.0
enable
enable

```

And vscode settings:
```json
{
"xml.fileAssociations": [
{
"pattern": "**/*.csproj",
"systemId": "https://raw.githubusercontent.com/dotnet/msbuild/main/src/MSBuild/Microsoft.Build.xsd"
}
],
"xml.validation.namespaces.enabled": "onNamespaceEncountered"
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.