dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.65k stars 1.05k forks source link

`dotnet build` should error out when building legacy project #9612

Closed rainersigwald closed 2 weeks ago

rainersigwald commented 6 years ago

From @onovotny on July 19, 2018 15:56

Steps to reproduce

Create a new .NET Framework project using the legacy template. Run dotnet build on it. It works, sometimes.

https://github.com/reactiveui/refit/issues/511#issuecomment-406326126

However, if some NuGet references do things with custom targets, it can quickly error out. Also, certain project types, like WPF/WCF will currently fail.

This can be remedied with an error if dotnet build detects that it's a legacy project type.

The current behavior conveys the wrong expectations that it should work.

Copied from original issue: Microsoft/msbuild#3526

rainersigwald commented 6 years ago

This isn't easily possible: there's not actually a distinction of "project type" except within the solution (which may or may not be involved in a command line build process).

Even with full-framework MSBuild.exe, a build can fail because a particular environment doesn't have all the right Visual Studio workloads or SDKs (in the classic, not project-element sense) installed.

That said, this is definitely a pit of failure. I'm going to move this to the CLI repo; we may be able to apply some heuristics before invoking MSBuild on projects through dotnet build.

nguerrera commented 6 years ago

I need a "hard problem" label like coreclr

rainersigwald commented 6 years ago

Oh man, so do we!

github-actions[bot] commented 1 month ago

Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.

github-actions[bot] commented 2 weeks ago

This issue will now be closed since it has been labeled 'stale' without activity for 30 days.

rainersigwald commented 2 weeks ago

Note that there have been some MSBuild-side improvements here https://github.com/dotnet/msbuild/pull/9625.