Tuesday, March 29, 2016

I'll be Speaking at VSLive! Austin - Discount Code to Attend


I’ll be speaking at Visual Studio Live!, May 16-19 in Austin. Surrounded by your fellow industry professionals, Visual Studio Live! provides you with immediately usable training and education that will keep you relevant in the workforce.

I’ll be presenting the following sessions:
SPECIAL OFFER: As a speaker, I can extend $400 savings on the 4-day package. Use offer code AUSPK08 or register using the link here: http://bit.ly/AUSPK08_Home

Amplify your knowledge at Visual Studio Live! Austin — bring the issues that keep you up at night and prepare to leave this event with the answers, guidance and training you need.  Register now: http://bit.ly/AUSPK08_REG

Friday, March 4, 2016

Why is the tsconfig.json file not copying my TypeScript files to wwwroot?

If you've been looking into ASP.NET 5 (eventually .NET Core 1.0) and working with TypeScript you'll notice things are very different than when using older versions of ASP.NET. Specifically the need to configure your TyoeScript virtual project using a tsconfig.json file.

Within the file you'll need to add a line such as the following to indicate where the transpiled .js files will be copied in wwwroot:

"outDir": "../wwwroot/appScripts",

The source directory has a documented convention though (at least at the time of this entry) that could be easily overlooked. I found the information on this GitHub thread. The tsconfig.json file will only check for TypeScript files in the scripts folder. Therefore you must have your tsconfig.json file within the /scripts folder in order for the outdir value and ultimately copying of files to work.


Fixing a npm Package That Will Not Reinstall


Recently when working on an Angular 2 app in VS.NET 2015 using an ASP.NET 5 template I began to see build errors that Angular 2 was missing. 



I was having trouble getting Angular to reinstall no matter which version I selected in my package.json file. It didn't matter if I deleted the local files or npm cache as nothing would work.

Upon inspecting the output I noticed the following errors:


npm ERR! error rolling back  errno: 10,
npm ERR! error rolling back  code: 'EBUSY',



Upon further research and some nudging from the problem on this GitHub link, it appeared a file was locked. The answer -> reboot the Windows machine. This does appear to be a Windows issue with file locking of some file(s) within the npm package and causing the error.

Upon reboot, I right-clicked 'Dependencies' and selected, 'Restore Packages.' Sure enough the Angular 2 npm package reinstalled successfully. Previously the angular2 folder existed but there was nothing inside of it. If you ever have any issues getting a npm package to install, always make sure to read the output in the VS.NET console to shed light on any issues.