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

dotnet build: targets switch ignored #8610

Closed
AXRO-BentonCulp opened this issue Mar 28, 2023 · 5 comments
Closed

dotnet build: targets switch ignored #8610

AXRO-BentonCulp opened this issue Mar 28, 2023 · 5 comments
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@AXRO-BentonCulp
Copy link

Issue Description

I was trying to add a tag to a docker image, and had to realize I didn't know the right AfterTarget.
Trying to list the targets, using dotnet build simply ignores the -ts and -targets switches and actually builds the project.

The following output was produced:
MSBuild version 17.4.1+9a89d02ff for .NET
Determining projects to restore...
All projects are up-to-date for restore.
ProjectName -> D:\ProjectName\ProjectName\bin\Debug\net6.0\ProjectName.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:02.01

Steps to Reproduce

Open VS and create a Blazor Server App (.Net 6, Docker enabled, Linux OS in docker, No Authentication, HTTPS enabled, TLS allowed)
Open Developer Powershell Window in VS, or navigate to the folder in a Powershell window
Type: dotnet build -targets
and hit enter

Expected Behavior

Output the targets, as described here:
https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-targets?view=vs-2022

Actual Behavior

Builds the project

Analysis

No response

Versions & Configurations

PS D:\BlazorApp1> dotnet build version
MSBuild version 17.4.1+9a89d02ff for .NET
MSBUILD : error MSB1009: Project file does not exist.
Switch: version

@AXRO-BentonCulp AXRO-BentonCulp added bug needs-triage Have yet to determine what bucket this goes in. labels Mar 28, 2023
@baronfel
Copy link
Member

@AXRO-BentonCulp did you have a solution in the same directory? If so, I think you're hitting #7697.

@AXRO-BentonCulp
Copy link
Author

AXRO-BentonCulp commented Mar 28, 2023

What exactly do you mean by 'solution in the same directory'?

I am running the command 'dotnet build -targets' inside the folder with the .sln file
(I think that would count as a yes.)
Not inside the folder of the (startup) project file

@AXRO-BentonCulp
Copy link
Author

After reading #7697 : Yes

@AXRO-BentonCulp
Copy link
Author

Sorry for creating a duplicate.

@baronfel
Copy link
Member

No worries at all, happy that you reported in the first place. I'll go ahead and close this as a duplicate now that we've got confirmation 👍

@baronfel baronfel closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

No branches or pull requests

2 participants