-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Revert DisableWinExeOutputInference
#16563
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
This was the Pull req. #12152 |
Thanks for the feedback. We should have limited this change to only projects targeting 5.0 and newer so we did not affect existing projects. We have rectified that going forward: #16472. This was an attempt to fix existing apps that used templates that incorrectly defaulted to OutputType=Exe for a Windows Desktop application. That application type should not have default behavior for including the console window spawning. There are many scenarios that customers would still want the console window but we did not want that to be the default behavior. As mentioned in the link you included, we also want to align around OutputType going forward for multi-targeting to other platforms that don't support winexe. |
@sfoslund @marcpopMSFT |
@marcpopMSFT Closed? Really? So the reason for this change was a mistake in some templates? As @jogibear9988 pointed out, how are users supposed to switch to exe instead of winexe using just the Visual Studio UI? I still think the changes should be reverted. |
@marcpopMSFT Will the final design always respect |
We have heard the feedback. I know there are a lot of different issues on this, so most people probably didn't see my explanation here: dotnet/docs#21952 (comment) The change wasn't made to support existing templates. It was a forward-looking change, so that .NET Maui app projects could specify a single <OutputType>Exe</OutputType>
<OutputType Condition="'$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))' == 'Windows'">WinExe</OutputType> For .NET Maui, we are still considering what the right design is. Right now what we would like to do is create a new
For Sdk-style projects (the only ones affected by this change), you can edit the project file in Visual Studio (without unloading). You can double-click on the project in the Solution Explorer to open the project file, or right click on it and select "Edit Project File". Then you can add the following property: <DisableWinExeOutputInference>true</DisableWinExeOutputInference> |
Thanks @dsplaisted. I'm assuming that inference only applies when And whenever |
No you're wrong. And that's the issue I have with it. You can specify the output type (select in Visual Studio UI the "Console Application"), close the settings, and when you open them again they are reverted. |
@jogibear9988 I'm sorry I'm not sure what I'm wrong about - I just asked a couple of questions (i.e., I didn't make any assertions). The second question could perhaps have been phrased a bit more like a question and a little bit less like an assertion... ☮️ |
@vatsan-madhavan that there is only inference when output type is not specified. You can specify it, but you need to add "DisableWinExeOutputInference" that your specfied type will be used. |
@dsplaisted If this is done to support MAUI and use "exe" on platforms that are not windows, why isn't it done that way? Assuming "winexe" only applies to Windows and does not exist on ios or android it would be logical to translate "winexe" to "exe" on those platforms. |
And it should not depend on |
Agreed. Really hope this UI can be improved in the future. This is very frustrating at the beginning indeed. Thankfully there is Bing (or Google) that let me know about this issue. No matter how it interferes with MAUI, I think at the end there should still be an option to open the console window so that we can easily inspect debugging info printed from the convenient |
Hi folks, Sorry for the inconvenience this caused. We've reverted the change for .NET 6: #19651 |
With #11398 the
OutputType
a user explicitly sets in his projects is ignored, except when he setsDisableWinExeOutputInference
.This is not acceptable and was not asked for by the community.
#11398 was not discussed and the feedback given there was simply ignored.
We now have a very, very confusing behavior where the users explicit choice of setting
OutputType
toexe
is completely ignored.Please see the following issues for reference:
There wasn't even an explanation why this should be changed in the first place.
The reasoning in the documentation at https://docs.microsoft.com/de-de/dotnet/core/compatibility/windows-forms/5.0/automatically-infer-winexe-output-type states "It's assumed that most users don't want a console window to open when a WPF or Windows Forms app is executed".
May i ask who assumes this because of which issues?
Was this requested by someone? #11398 did not mention any users/issues identifying this as an issue.
The text was updated successfully, but these errors were encountered: