Category Archives

50 Articles

Visual Studio Tips

Next Difference Source Control – Visual Studio Shortcut

Posted by matteskolin on

Before Checking in changes to source control, it is important to be able to quickly review all the changes for each file.

If a file is very large, scrolling through the file to find the changes is difficult.

To quickly jump to the next difference, use the arrows above the file tab.

For some reason my eyes were missing these arrows for awhile, so I’m making this post to remind myself to use them.

Keyboard shortcuts are also built in.

Go to previous difference: Control + Shift + F8
Go to next difference: Control + F8

Visual Studio Tips

Package Management Tip – lightning speed workflow!

Posted by matteskolin on

I really appreciate how VSCode makes it possible to do things faster, compared to Visual Studio proper.

Managing Nuget packages for me in Visual Studio Proper always involved opening up the Nuget GUI, searching for the package, selecting a version, clicking check boxes to add the package to specific projects, and then clicking through a bunch of confirmation prompts before finally installing the package.

In VSCode, a more streamlined way of doing this is to add the PackageReference directly to the project .csproj file. Just add a PackageReference element inside an ItemGroup with the Package Name and version.

You can do this in Proper as well, but it is more difficult to edit the project file, as the entire project may need to be unloaded and loaded, which can be slow.

<ItemGroup>
<PackageReference Include="Polly" Version="7.2.1"/>
</ItemGroup>

Save the Project File and run the dotnet restore command. The project will be built and the package assemblies will be copied to the project output folder.

dotnet restore

After editing the .csproj file I use Cntrl + ~ to jump down to the VSCode terminal to run the dotnet restore command. Managing packages this way is fast and easy.