Skip to content

net 6.0 throws NETSDK1005 error during build/publish via cmd as it does not accept the property "TargetFramework(s)" #19628

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

Closed
swetha-dran opened this issue Aug 10, 2021 · 2 comments
Assignees
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@swetha-dran
Copy link

#19487 - Could not re-open this issue So I'm creating a new one.

Below is the my csproj file,

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

and running the below command fails,
dotnet publish "MY_TEST_APP_CSPROJ_PATH" -c Release -o "RELEASE_PROJ_PATH" -r win10-x64 /p:TargetFramework=net6.0

But, I can run the below command fine,
dotnet publish "MY_TEST_APP_CSPROJ_PATH" -c Release -o "RELEASE_PROJ_PATH" -r win10-x64 /p:TargetFramework=net5.0

To be clear, I can build totally fine with net 5.0, it fails only with net 6.0.

Note: As a workaround, I updated csproj to accept the variable (TF)
<TargetFramework>$(TF)</TargetFramework>
and running the below command works,
dotnet publish "MY_TEST_APP_CSPROJ_PATH" -c Release -o "RELEASE_PROJ_PATH" -r win10-x64 /p:TF=net6.0

@ghost ghost added Area-NetSDK untriaged Request triage from a team member labels Aug 10, 2021
@iskiselev
Copy link

Can #19487 be reopened and this been closed to discuss it in one place?

@marcpopMSFT
Copy link
Member

Old bug triage: tracked in the other bug.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants