I pressed Ctrl+Alt+F on visual studio 2017 to open F#interactive. But it doesn't interact. For example, when I typed
2+2;;
Nothing happens. I thought it would print
val it : int = 4 . But nothing gets printed. Maybe I got an error before that line and that made it not working properly? But when I close the F# interactive window using the x sign on the top right of the window and reopen it using Ctrl+Alt+F, I don't get a new window, instead I get the Window as it were when I closed it. So how should I make this work properly? Is this the right way to open F# interactive on visual studio? Here is a image:
It might be that F# Interactive is stuck somehow.
You can reset F# Interactive in Visual Studio by right clicking in the F# Interactive window and select "Reset Interactive Session" from the drop down menu.
Related
How can I remove the little sidebar to the left of the code in Visual Studio 2019? I mean the little minus signs that appear next to each function or code block header and, if clicked, minimize that function or code block.
Is there a way to disable these?
The feature is known as "outlining" and enabling/disabling it is language-specific. In all cases, use the "Options" command from the "Tools" menu and then, in the left-hand pane of the displayed pop-up box, open the "Text Editor" node.
For C/C++ files, the option is under the "View" sub-node:
For C# files (and also Basic, F# and Python), it's under "Advanced":
For other languages, it's likely to be in one or other of those places, but I can't guarantee that. In all cases, changes only come into effect on files that are opened after the option is changed.
If you have another specific language for which you can't find this option, just let me know and I'll try to help.
Some time ago, Visual Studio 2019 told me that the "Output" window caused a Visual Studio start-up delay of X seconds and offered me to hide the window on start.
I accepted that offer, and now, after some time, I discovered that having to re-pin the Output window once per Visual Studio session is super-annoying, and that I would like things back the way they were before.
I browsed through the Visual Studio options (specifically Environment/Startup and Environment/"Tabs and Windows"), but I did not find an option to undo that change. What did I miss?
I know that I could reset Visual Studio to default settings, but I want to avoid that, because then I'd lose all my custom settings. (No bounty will be awarded for suggesting this, unless the answer also proves that there is no other option.)
I also know that I could pin the output window and then "save" the layout as a custom layout. I don't want that, I want to modify the "default" layout loaded on start.
(Rubber-duck debugging at its best: 5 minutes after starting a bounty I find the solution myself. Go figure!)
In the Visual Studio menu, go to Help/Visual Studio Performance Manager, which brings up this helpful dialog:
Setting this option back to "Use default behavior" fixes the issue.
I'm trying to automate a windows desktop application and everything is fine until in one of the steps in my application, I have to click on a "Browse" buttom that opens a windows explorer window to select an image and load it.
The thing is that I do not know how to make WinAppDriver focus in this new window, to be able to select the image and load it.
This is a part of the desktop application, and when sending click on Browse:
You probably need winappdriver to change its current handle to the one from the new explorer window. I'm not sure about the Python syntax, but in C# you do it like this:
driver.SwitchTo().Window(Driver.WindowHandles.Last());
The Last() function just selects the most recent added windowHandle.
Make sure you keep your previous window handle around, so you can switch back once the explorer window closes.
Also take a look at these posts. Its about webdriver but the functions are similar:
webdriver C#
webdruver java
The help at Microsoft Docs explains
"To run F# Interactive through Visual Studio, you can click the appropriate toolbar button labeled F# Interactive, or use the keys Ctrl+Alt+F. Doing this will open the interactive window, a tool window running an F# Interactive session. You can also select some code that you want to run in the interactive window and hit the key combination ALT+ENTER. F# Interactive starts in a tool window labeled F# Interactive. When you use this key combination, make sure that the editor window has the focus."
I am using VS2017 professional.
I have F# language support checked in the .Net desktop development work load but I cant find the F# Interactive button.
What toolbar should I be looking in for it>
You can also use the menu bar: View > Other Windows > F# Interactive.
Visual Studio has a handy quick launch bar at the top that you can use to search. F# Interactive is here:
To be honest, the "toolbar" you are looking for is actually VsCode with Ionide. :D
Now in VS2013 and F#3.1.1, I noticed that it is a bit cumbersome to send code to F# interactive.
There are separate menus for but no keyboard shortcuts for
sending project output as reference to F# interactive
sending project references to F# interactive
In the editor window, there is no "send whole file" to f# interactive. You have to select it all, right click and send.
It feels very unpolished. Are any faster ways of doing this?
What are your IDE workflows?
As I am righting these questions, i think about maybe using shellplus powershell integration for invoking this...
Just in case it helps: you can right click on any reference in the Solution Explorer and do 'Send reference to interactive' - or you can right click on the References node and send them all to interactive.
You can also do this in your source:
#r #"c:\mycode\myassembly.dll"
...and you can surround that with #if interactive to stop it messing up your compiles.
#if INTERACTIVE
#r #"c:\temp\myassembly.dll"
#endif
Finally you might also want to look at script files (.fsx) - googling for "f# script files" produces some useful references.
For sending references, yes, you have to right-click on the individual reference or the references node and click "Send reference to FSI." Not perfect if you prefer keyboard shortcuts, but much improved from VS 2012 when you had no choice but to type out a full #r statement every time...
For sending code, Alt+Enter is the easiest/most popular shortcut. Highlight the code you want to execute (using either mouse or keyboard), then hit Alt+Enter. To send the entire file, just use select-all (Ctrl+A) to highlight everything.