Tuesday, July 12, 2016

Pre-compilation as part of your Kudu deployment

We're currently using Kudu to do CI builds/deployments to our development Azure website, so every time a new commit hits our GitHub dev branch this automatically triggers a new build and deployment. 

To speed up the initial load time of the Azure website after a deployment, I wanted to pre-compile the website as part of that pipeline.

It showed to pretty easy as we already had a custom deploy.cmd for Kudu.
Here are the pre-compilation steps added after the existing KuduSync.







Wednesday, April 6, 2016

Connecting SQL Server Management Studio and SQL Server Profiler to LocalDB

I find the Visual Studio 2015 SQL Server Object Explorer to be quite slow. Also, as anybody working with an ORM, I want to monitor the SQL-commands being fired against the database during development to make sure I didn't screw up too much. 

Wouldn't it be nice to use good ol' SQL Server Management Studio and the SQL Server Profiler for that? I think so, but the Internet says NO! I've accepted that as a truth for some time, but yesterday I decided to revisit the topic, and actually found out that it works just fine.

Now I can enjoy both the speed of SSMS and the power of the Profiler without replacing LocalDB. 


  1. Install SQL Server Management Studio, mr Hanselman has created a nice download overview here:
    http://www.hanselman.com/blog/DownloadSQLServerExpress.aspx
  2.  Open a Command Prompt and run this command
  3. Now find the instance pipe name for the instance you want to connect to
  4. Use the instance pipe name as server name in the connect dialog for SSMS, and you're ready to rumble.


Friday, January 22, 2016

"The file name you specified is not valid or too long. "

You've probably seen that message when trying to delete a deeply-nested folder on your Windows machine at some time.

I've seen various solutions around, but using node.js and a npm package called 'rimraf' was new to me.

So provided you've got node.js and npm installed, just follow these steps and bid that folder farewell:
  1. Install the 'rimraf' npm package:
    npm -install -g rimraf
  2. Run the command:
    rimraf EvilFolderThatWillNotDie

 Barabapaaraaa - I'm loving it!

Thursday, December 3, 2015

Azure tips & tricks and other useful information

Here's a bunch of useful tips/tricks/information I've come across while playing with Azure.

Wednesday, May 27, 2015

Multiple https websites in IIS, and wildcard certificates not being that wild

Fiddling around with certificates is just as writing regular expressions; you do it just infrequently enough to forget the details and how you solved the problem at hand last time...


Problem

I recently needed to add a second website to an IIS7 server, giving me something like this:
  • website1.domain.com (already setup, supporting both http+https bindings)
  • website2.domain.com (new website)
I setup the new website2 to use the same ip and port binding as website1, but obviously with a separate host header. 

Now I wanted to add a https binding to website2 as well. I specified the same wildcard certificate as website1 was using, but for some reason the Host name input field was disabled.
Without being able to specify a host header IIS naturally tells you "hey - you've already got a binding for that ip+port combo" if you try to start both websites at the same time. 

I did not order or install the certificate on the server, but I knew it was a wildcard certificate, and I could see that it was issued to "*.domain.com" in the MMC Services snapin.

What the funk?!
I know I've solved this issue before... // recalling from tape

Solution

The solution or root cause if you will, showed to be the certificate's friendly name.
Even  though the certificate was issued to "*.domain.com", the guy ordering the certificate from the CA specified "domain.com" as friendly name, and if the IIS7 Manger is told to use a certificate without a leading "*." as friendly name it will not recognize it as a wildcard cert, and hence disable the Host name input field.

So changing the friendly name of the certificate to "*.domain.com" was all it took . 
(MMC Services snapin->double click the cert->details tab->edit properties)

Monday, May 25, 2015

Sublime Text and JSHint problem

Had some trouble getting JSHint to play nicely with Sublime Text 2 today.
I use it on my other dev machine, but for some reason I couldn't get it to work on my current Windows machine.

The Sublime Package Manager install went fine, but every time I triggered a build I got this error:
[Error 2] The system cannot find the file specified








After some #¤%&!! the problem was solved.
I had forgotten to install the 'jshint' npm package. stupid.me();
npm install -g jshint



Wednesday, December 10, 2014

contentEditable - a nifty little attribute



The contentEditable attribute (part of the HTML 5 spec) had totally passed my radar.


Spin up your favorite developer toolbar and execute this in the console:
document.body.contentEditable = true;

You can now fiddle around with the texts on the page and very quickly see how your design copes with various text lengths. 

Creds to Shay Friedman for sharing this tip on the Chrome Developer Tools .NET Rocks show!