Here are some tips and tricks that I learnt the hard way to maintain “round trip” project state for a Raspberry Pi 2 Windows 10 IoT Core project on GitHub. Hopefully it’ll give you back the hours I lost sorting this out.
A bit of context, I maintain the “Maker Den” Windows 10 IoT Core Raspberry Pi 2 project on GitHub, it’s designed to be an accessible IoT framework and maker experience. One of my key requirements is when the project is downloaded or cloned from GitHub it is in the exact state I saved in it so it just works when a user opens it in Visual Studio 2015. No fiddling with the processor architecture, no setting up the remote device name etc.
I needed the project to remember
- It’s targeting the ARM processor architecture
- It’s targeting a remote device – namely the default “minwinpc” Windows 10 IoT Core computer name.
- What references and frameworks the project uses.
Targeting ARM Architecture
This information is held in the solution root (hidden) directory “.vs” in a file named “.suo”
Remote Device Name
This information is stored in the “StartUp Project” folder in a file that matches your project file name with the “.user” extension. Take a look in this xml file and you’ll see the remote device name.
Project References and Frameworks
This information is held in the “project.lock.json” file, it’s information about the target SDK and references. See http://docs.asp.net/en/latest/dnx/overview.html and http://blog.brunomlopes.com/2015/07/should-i-put-projectlockjson-in-source.html for more information.
How to Fix
The default Visual Studio GitHub “.gitignore” file is your frenemy and this is where you need to be better acquainted.
- Open up the project “.gitignore” file in the text editor of your choice
Search for and comment out the following ignore types with a # at the beginning of each of these lines
- Save the changes
- Open the git command prompt in the root of your solution and using the “Git add .vs/*” command add the contents of the .vs/ to the local git repository
- Now do a git push or sync to ship these files up on to GitHub.
- Test by downloading/cloning and building the project from GitHub, hey presto, all your project settings should now be in place just as you wanted:)