Skip to content
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

Failing to change TargetFramework to TargetFrameworks when multi-targeting gives unclear error message #7868

Open
burtonrodman opened this issue Dec 10, 2024 · 2 comments

Comments

@burtonrodman
Copy link

Type: Feature Request

  1. in a C# project targeting a single TFM with "TargetFramework",
  2. add a second TFM (without changing the TargetFramework element to TargetFrameworks)
  3. receive the error message below that is not clear, or even pointing to the proper source file that contains the issue
Determining projects to restore...
C:\Program Files\dotnet\sdk\9.0.101\NuGet.targets(170,5): error : Sequence contains no matching element [D:\source\MySolution.sln]

Extension version: 2.55.29
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.22631
Modes:

@burtonrodman
Copy link
Author

EXPECTED RESULT:
a more clear error message is displayed like:

MyProject.csproj(7,5):  error:  The TargetFramework property may only contain a single TFM.  Did you mean to use TargetFrameworks?

@burtonrodman
Copy link
Author

or better yet, either deprecate the TargetFramework (singular) property and push everyone to use TargetFrameworks, or add support for multiple TFMs in the TargetFramework property and deprecate TargetFrameworks (plural)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant