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

I can make Visual Studio disappear by using "Other flags" in the properties window #13549

Closed
abelbraaksma opened this issue Jul 22, 2022 · 8 comments · Fixed by #13702
Closed
Assignees
Labels
Milestone

Comments

@abelbraaksma
Copy link
Contributor

abelbraaksma commented Jul 22, 2022

If you write --version in the "Other flags" (motivation: I wanted to see the FSC version on each compile), and if you then switch to any source file, the whole of Visual Studio disappears.

Repro steps

Minimal repro zip file: CrashVisualStudio.zip

  • Create a new solution + project in VS 2022
  • Go to Project Properties and set "Other flags" to --version
  • Switch back to the main source (i.e., Ctrl+Tab or by clicking)
  • Boom! The big disappearing act is complete: it crashes without any warning.

Second repro:

  • Assume the above fsproj change is saved
  • Try to open the solution of project in VS 2022
  • Bring focus to any source file in that project
  • Boom! VS disappears again: it crashes without any warning.

See video capture (sorry for the delay, I hit Ctrl-S to save, as that is often another way of crashing):

img

Expected behavior

Not sure if --version is valid here, but valid or not, Visual Studio (version 2022) should not disappear.

Actual behavior

Visual Studio crashes without a crash report. Sometimes there's an auto-restart which will hang, most of the times this restart does not happen. Sometimes child processes are killed, sometimes they remain around (like MSBuild.exe).

Known workarounds

Don't use "additional compiler options" aka "other flags".

Related information

I only tested this on a Windows 10 machine, I could check a Windows 11 machine for good measure. Didn't test with VS Code, only VS 2022 Community Edition.

@abelbraaksma abelbraaksma changed the title I can make Visual Studio disappear by using Additional Compiler Options I can make Visual Studio disappear by using "Other flags" in the properties window Jul 22, 2022
@KevinRansom
Copy link
Member

Yeah this is not a good experience.

@vzarytovskii vzarytovskii added this to the August-2022 milestone Aug 1, 2022
@psfinaki
Copy link
Member

Can reproduce, jumping on that.

@psfinaki
Copy link
Member

psfinaki commented Aug 15, 2022

Okay so this is happening because of #10099. I am currently figuring out the original reasoning and thinking if we can remove just remove some mess here instead of adding more conditions to the code. Either way hope to have some kind of fix in upcoming days :)

@abelbraaksma
Copy link
Contributor Author

@psfinaki, sounds like fsc --version now gives an error because the option isn't there anymore? I mean, I didn't see that on the commandline. Though, a more generic way forward is probably that any option that raises an error shouldn't immediately crash the whole VS, but maybe just be dismissed when the user tries to save it, or ignored (instead show the error when he tries to build).

@vzarytovskii
Copy link
Member

@psfinaki, sounds like fsc --version now gives an error because the option isn't there anymore? I mean, I didn't see that on the commandline. Though, a more generic way forward is probably that any option that raises an error shouldn't immediately crash the whole VS, but maybe just be dismissed when the user tries to save it, or ignored (instead show the error when he tries to build).

It should be there:

> dotnet .\artifacts\bin\fsc\Release\net6.0\fsc.dll --version
Microsoft (R) F# Compiler version 12.0.4.0 for F# 6.0

It just likely does something weird like explicit exit, which crashes VS and/or msbuild process.

@psfinaki
Copy link
Member

Yep, it should be there, it just shouldn't crash VS, similar to how --help doesn't crash it. The fix is coming

@psfinaki
Copy link
Member

psfinaki commented Aug 16, 2022

@abelbraaksma see the attached PR - I even added a video clip to match your video clip! :)

@abelbraaksma
Copy link
Contributor Author

Just (finally) tested it locally with latest from main. Works. Thanks so much!

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

Successfully merging a pull request may close this issue.

4 participants