During development is often useful to delete the saved data. Here are a couple ways you can accomplish this task:
- You can try to uninstall your app and reinstall it
Another alternative is:
- Go to %localappdata%\Packages\<packageID>
- Note: “%localappdata%” is “%USERPROFILE%\AppData\Local”. For example c:\users\rick\AppData\Local
- Search closely for your file names under LocalState/RoamingState and delete them. Double check that other folders don’t have your files either.
Follow these steps to automatically pull your UWP project via Git using Jenkins:
- Install Jenkins
- In Jenkins (usually http://localhost:8080/ ), create a new item and select Freestyle Project
- Once created, in the projects configuration page scroll down to build and click on Add build step -> Execute Windows batch command
- Enter the following:
call “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat”
msbuild C:\projects\sample\sample.jsproj /t:Clean;Rebuild /p:Configuration=Release
- The first line is assuming you installed VS 2015 in the default folder.
- If you want to compile the whole solution just target the .sln instead of the project in the second line
- If you want to target a specific platform, just add “;Platform=x86” (without quotes) in the second line
- Click Save
- You should be able to run the project by clicking Build now
Jenkins comes with support for source control systems such as CVS or SVN (Subversion). If you want/need Git support you’ll need to install a plugin. Here are the steps add Git integration:
- Go to Manage Jenkins
- Click on Manage Plugins
- Click on Available and search for Git
- Install the GitHub plugin
- After installing go to Manage Jenkins and click on Configure System
- Scroll down until you see Git / Git Installations
- Enter your path to Git executable, could be something like: c:\program files (x86)\git\bin\git.exe
- Save your changes
- Go to your project configuration
- Scroll down until you see Source Code Management and select Git.
- Enter the repository URL
- Add your credentials
- Enter branch to build if necessary
- Scroll down to Build section and change the msbuild line to
msbuild sample\sample.jsproj /t:Clean;Rebuild /p:Configuration=Release
- This is needed so that Jenkins uses the project downloaded from Git
- The folder where Jenkins does this work is in: C:\Program Files (x86)\Jenkins\jobs\[project name]\workspace
Every time you click build it will pull the code from Git and make a build.
Follow these steps to get OAuth working in Windows Store applications (UWP).
- Go to Windows Dev Center
- Create a new application
- Once in app overview click on “App management” -> “App identity“
- Take note of the Package SID (starts with something like: S-1-15-2-more-numbers)
- Open the WebAuthenticationBroker sample from Windows 10 Samples on GitHub
- Right click on the project name and select “Store” -> “Associate App with the Store“
- Follow the steps until you see the application created in your Windows Dev Center to associate it with the current project.
- Open scenario1.js and change line 43 where it reads: scope=read_stream to scope=public_profile,email (or any other set of properties you want to access.)
- Register as Facebook developer
- Create a new application
- Go to “Settings” and click “Add Platform” -> “Windows App“
- In the Windows Store ID field enter the Package SID that you took note before (refer to step 4)
- Click “Save changes“
- Click on “Advanced” – tabs on the top of the page
- In the “Client OAuth Settings” make sure that “Client OAuth Login” is checked as “Yes“.
- Click on “Teat Apps” on the side menu.
- Click on “Create a Test App” and create a test application with the name of your choice.
- Once in the dashboard of the newly created application take note of the “App ID“.
- Click on “Roles” in the side menu.
- Click on “Test Users” -> “Add” -> “Create Test Users“.
- In the “Test Users” section click on “Edit” -> “Change the name or password for this user” and enter a password of your choice.
- Take note of the Test User’s email and password.
- Return to Visual Studio and run the application.
- Enter the App ID (refer to step 18) in the “Facebook App ID” field.
- Enter ms-app://Package SID (refer to step 4 to get the package SID) on the “Callback URL” field.
- Click on “Launch“.
- Enter the Facebook’s test user email and password (refer to step 22).
- Go to Google Developers Console (https://console.developers.google.com/)
- Create a new project
- In the “Use Google APIs” section click on “Enable and manage APIs“
- In the “Social APIs” section click on “Google+ API“.
- Click “Enable API“.
- Click “Credentials” in the side bar menu.
- Click “Add credentials” and then select “OAuth 2.0 client ID“.
- Click on “Configure consent screen“.
- Enter a product name and click “Save“.
- In the “Application type” select “Other” give it a name (e.g. “Windows Store App”) and click “Create“.
- Take note of the client ID.
- Go to Visual Studio and run the WebAuthenticationBroker application.
- Switch to the Google OAuth using the hamburger menu.
- Enter the Client ID (refer to step 11).
- Enter google credentials.
Note: If your project crashes around line 57:
on desktop or tablet make sure to change it to
if (Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAndContinue &&
Windows.System.Profile.AnalyticsInfo.versionInfo.deviceFamily == "Windows.Mobile")
To connect from your local PC to your Raspberry Pi 2 follow the next steps:
- Check your Pi IP and/or computer name. (Default computer name is MINWINPC.)
- Search for PowerShell in Windows and run it with administrative privileges.
- Type: net start WinRM
- Type: Set-Item WSMan:localhostClientTrustedHosts -Value MINWINPC
- You may need to click “Y” to allow this change.
- Type: Enter-PsSession -ComputerName MINWINPC -Credential MINWINPCAdministrator
- Enter the password which is: p@ssw0rd
You’re now connected.
For more complete and detailed instructions follow: http://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
For those who want to install Windows 10 IoT but don’t want to install Windows 10 follow the steps below:
- Insert the SD card where you want to install Windows 10 IoT
- Format it to FAT32 if needed.
- Download Windows 10 IoT https://ms-iot.github.io/content/en-US/Downloads.htm
- Unzip the downloaded ISO and you should see a file called Flash.ffu
- Download the Windows 10 ADK at the end of this page: https://msdn.microsoft.com/en-us/windows/hardware/dn913721.aspx
- Search for Windows Imaging and Configuration Designer in your installed programs and run it.
- Where it says deploy (top left corner right under the title bar) click on the down arrow and select the device where you want to install Windows 10 IoT (either a USB drive where your SD card is or a removable drive if you have one in your computer.)
- Click on deploy.
- Select the Flash.ffu file you downloaded before and click open.
- Click next.
- Make sure the target disk is correct and click next.
- Click Flash.
After a few minutes you should have Windows 10 IoT installed in your SD card and you can now try it on your Raspberry Pi 2.
The new version of CLIArgsMadeEasy2 added support for VS2015RC. Grab it here while quantities last!
There’s a great little tool called TypeDoc that allows us to generate html documentation based in our comments inside our TypeScript files similar to what JavaDoc does. To use this tool follow these steps:
- Install nodejs: http://nodejs.org/dist/v0.10.35/node-v0.10.35-x86.msi
- Open command line and run nodejs by typing: node
- In the nodejs prompt install typedoc by typing: npm install –global typedoc
- Type: typedoc -t ES5 –out doc/ references.ts
This will compile all the documentation (classes, namespaces, functions, etc.) that can be referenced by the file references.ts and it will be put under the doc folder in the current directory where that command is ran.
It’s preferred to update your project’s documentation from time to time and TypeDoc has integration with tools like Grunt but if you want this to run after you create a build you can add this command to the post build events list of commands the way I’ve shown in the previous post. For example:
<Exec Command="typedoc -t ES5 --out "$(ProjectDir)/doc/" "$(ProjectDir)/tsDec/references.ts"" />
TypeDoc follows JavaDoc comment tags:
@param <param name> <description>
* This is a function.
* @param arg This is the argument.
* @returns Returns a value.
function func(arg: text): string;
* This is a name.
var name:string = "a name";
You can also use the @preferred tag if you have different comments for the same thing (e.g. a module that is declared in different files and has different comments in both files or an interface and its class implementation) and you want to use a specific comment over the other as TypeDoc will use the first comment that it finds.
You’ll notice that there’s a whole section that is commented out with this comment:
To modify your build process, add your task inside one of the targets below then uncomment that target and the DisableFastUpToDateCheck PropertyGroup.
Other similar extension points exist, see Microsoft.Common.targets.
So you just need to follow the instructions and add a command inside one or both of the pre/post build event xml nodes. To add a simple copy a file named lib.dll from the output directory to your project directory after building you’d do something like:
<Exec Command="copy "$(OutDir)/lib.dll" "$(ProjectDir)/"" />
Note: the " is intentional so that the string gets quoted when it’s used by the copy command.
– Are you using TypeScript?
– Please stop! Do yourself a favour and go learn TypeScript to use it in your project.
No problem, you just start slowly converting the code to TypeScript or you can create declarations (similar to a .h file for C/C++ projects) for your utility libraries that work just as well.
My TypeScript contribution to the world is a Player Framework (MMPPF) declaration file available at the DefinitelyTyped GitHub repository.
Enjoy and start using TypeScript!
Started playing with my Raspberry Pi this weekend and noticed that the wifi connection would not stay up for long when connected through SSH. After some digging online I found that the wifi was getting put in sleep mode. Here’s how to fix it:
- Create a new file named 8192cu.conf at the following location /etc/modprobe.d/8192cu.conf
sudo nano /etc/modprobe.d/8192cu.conf
- Write the following command
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
(This makes sure that the power management is turned off thus preventing the dongle from going to sleep mode.)
- You can go further and ensure that the connection remains up and stable by sending a ping request from your Pi to the router using crontab:
(Adds a new entry to crontab.)
- Enter the following at the end of the file:
*/1 * * * * ping -c 1 192.168.1.2
(Change the 192.168.1.2 to the IP of your router. The IP of the router can be found by opening a command prompt in Windows and running the ipconfig command and checking the number besides “default gateway“.)
If you don’t have a Edimax wifi dongle you may have to find how to disable the power management for your device.