Productivity Tips for Visual Studio 2017

I’ve written a few blog posts thus far regarding Visual Studio 2017, so I thought I would take some time to discuss the features that were introduced in this latest version that might help your productivity, or that you just may find useful.

You’ll notice that the title of this post mentions that they are “secret”. This is because all of these features are disabled by default, so you’ll need to enable them, either locally (per project) or globally, to take advantage.

Source: “Secret” Productivity Tips for Visual Studio 2017 – CodeProject

Coypu supports browser automation in .Net to help make tests readable, robust, fast to write and less tightly coupled to the UI

Based on Selenium WebDriver:
https://github.com/featurist/coypu/blob/master/README.md

A robust wrapper for browser automation tools on .Net, such as Selenium WebDriver that eases automating ajax-heavy websites and reduces coupling to the HTML, CSS & JS

 

Force xUnit.net to run tests serially

Force to run tests in test projects serially; (for integration or ui type of tests)
Add this to the xunit test project app.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
...
<add key="xunit.methodDisplay" value="method" />
<add key="xunit.parallelizeAssembly" value="false" />
<add key="xunit.parallelizeTestCollections" value="false" />
<add key="xunit.maxParallelThreads" value="1" />
...

docs:
https://xunit.github.io/docs/configuring-with-xml.html (.NET)
https://xunit.github.io/docs/configuring-with-json.html (.NET core)

 

 

AutoHistory – Visual Studio Extension to easily roll back code a few minutes or hours.

Have you ever found yourself wishing you could roll back a few hours to a piece of code you had working but have made changes to? This extension provides an early preview of an automatic, no-configuration history tracking facility for your local machine. Just install the extension, and whatever you do in your projects and solutions, it silently and efficiently tracks the changes you make to any files that you have opened in the Visual Studio Editor. Then, when you find yourself in need of back-tracking to

Source: AutoHistory – Visual Studio Marketplace

See this Channel 9 video: http://go.microsoft.com/fwlink/?LinkID=390499

C# .NET Selenium chromedriver.exe no disk in drive e: fix

If you get this alert message when debugging with the Selenium webdriver (v3.2) chromedriver (v2.27):

chromedriver.exe no disk
there is no disk in the drive. please insert a disk into drive e:

For me the problem was related to having an unmounted drive e: (open This PC window and check). If its not possible to unmount through windows right click menu, you can use this CMD: (run as administator):

mountvol e: /d

A simple bat file for this: (remember to run as Administrator):

@echo off
ECHO Must be runned as administrator to have access rights
mountvol e: /d
pause

 

GIT – How to ignore local changed file

If you have a config file or something similar you change on your local computer but dont want it to get marked as “modified”.

Use this command:

git update-index --skip-worktree [filename]

If remote repo gets an update on that file you will get notified about this on a pull.

From stackoverflow:
skip-worktree is useful when you instruct git not to touch a specific file ever. That is useful for an already tracked config file.
Upstream main repository hosts some production-ready config but you would like to change some settings in the config to be able to do some local testing. And you don’t want to accidentally check the changes in such file to affect the production config. In that case skip-worktree makes perfect scene.

If you have skip-worktree on a file and the upstream changes, you get “please commit or stash” when you try to pull

More info here:
http://stackoverflow.com/questions/13630849/git-difference-between-assume-unchanged-and-skip-worktree/13631525