Monthly Archives

5 Articles

Visual Studio Tips

Using Visual Studio Live Share.

Posted by matteskolin on

Visual Studio Live Share allows real-time collaboration inside the Visual Studio environment.

See this Microsoft Documentation linked here for a good introduction. https://docs.microsoft.com/en-us/visualstudio/liveshare/use/vs

I set up an instance of Visual Studio 2019 Preview Version as the Host on my laptop, and connected to it from a Visual Studio 2017 Instance on my Desktop. It is nice that Microsoft lets you collaborate with yourself for testing. I am logged in as the same MSA personal account.

This is very different from a screen share which is what I think of when I think of collaborating, because this is essentially what happens in the office when people gathers around someone’s machine to discuss code.

Focus Participants

The Focus participants feature allows a Live Share Participant to focus the other participants on the file they are working on.


Limitations
One thing that seems a little strange to me is that the focusing and following seems to only happen with the active Code editor window of the host or current presenter.

If for example, I want to create a new file or look at some files in the Solution Explorer, the windows that I am working in won’t be available to my collaborators.. This seems like a missing feature to me..

What Happens if I want to talk to my collaborators about the Project file structure or what type of file to create in the create new dialog.

You can however, share a command line terminal… but this doesn’t seem as useful to me as complete sharing..

I think a useful feature would be that if Live Share had a built in full screen share, so that the host can show other windows and applications.. and then switch back to normal live share mode when actually working on code…

git/workflow

VS – github – creating a branch and a pull request using the command line

Posted by matteskolin on

I have predominately used TFVC for so long that the git workflow is still a little fuzzy to me, so I am writing this post for myself to better understand git.

So, I started off trying to use Visual Studio and the cmd command shell.

I already have my git repository created FSharpAPI1. I have it connected to a remote repository on GitHub as well.

I started off with a push command to get things back in sync (I been working on this repo locally). I had a strange issue using the cmd shell to push to the remote repository. Apparently there was some issue with the Credential Manager git was using on Windows.

The request was aborted: Could not create SSL/TLS secure channel.

error in credential log

So I decided to reinstall git, and use Git Bash for Windows instead of cmd. The shell is very nice looking and allows me to use basic Linux commands like grep, alias, and ls to improve my workflow..

Creating the Branch
I used the git branch command to create a new branch called cleanup-comments-cap3

$ git branch cleanup-comments-cap3

I find it interesting that git doesn’t give you any success message that the branch has been created; we can, however, confirm that the new branch was successfully created using the git branch -all command. This command will list all branches locally and remote.

Next I execute the checkout command to switch to the new branch

git checkout cleanup-comments

What is kind of neat is that executing these changes in the command line are automatically visible in Visual Studio. Here in the below screenshot, my new branch has been checked out, and is now selected in Team Explorer

new branch appears in Team Explorer in Visual Studio (using git plugin VS 2017)

Creating the Pull Request
a Pull Request is functionality that is specific to github, not git, so in order to create an actual github pull request ( I wanted to do all of this on the command line), I had to download the Windows version of this command line tool here. https://github.com/github/hub

To downloado the hub tool, I first had to install the scoop Windows package manager using the following command in powershell..

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

This plugin allows me to now use the following command to create a pull request (Do not forget to push your changes to the remote origin first)

hub pull-request

Beautiful, the pull request has now appeared online in github…

my pull request created with the command line