Monday, 11 November 2013

IE11 - how to fix if you develop in IIS locally

When testing a site I usually develop in Visual Studio then test in IIS on the local machine rather than the built in web server in Visual Studio. Mainly because I tend to find it quicker, once set up I don't necessarily need VS open if I just want to show a site to a customer or I might want to muck around with IIS settings for a site which has a specific setup.

Anyway, IE11 breaks this setup and prevents me from viewing my sites in it due to some security thing which I don't really understand but there we go. Here is how to resolve! Try and go to the local site where it will complain about your connection, then click on Settings>Internet Options>Security>Local intranet then click on Sites and add the site (woohoo, I have to do this for the 50 or so sites I have setup locally...).

I then went to test the site which uses some nice CSS 3 effects and things like that but none of them showed up. I tried a lot of things, viewed other sites, then previewed the same file locally and on a remote server and they showed up differently... This irked me somewhat then found the shiny new Settings>Compatibility View Settings window, here I could then uncheck 'Display intranet sites in Compatibility View' which was checked by default.

I'm also reasonably upset that they've removed the previewing in another version from the developer tools. I understand why they've done this but it is a massive headache requires running a lot of VMs to check all of their browser versions (7,8,9,10 and 11, all of which have their quirks...) which I quite frankly can't be fished to do. How dull. At least before I had a quick and dirty 'it will look OK' kind of check.

Updates
I tried to load a site that I'm working on but all I got was "Service Unavailable HTTP Error 503. The service is unavailable." which was not very helpful. The application pool was killed every time I tried to load the site. A quick dig through the event logs and a bit of hair pulling later I found "The Module DLL C:\Windows\system32\inetsrv\rewrite.dll failed to load. The data is the error." coming up. A quick Google and I found that I just had to go to my "Programs and  Features" and repair "IIS URL Rewrite Module 2". Obviously.

I also had a bit of a weird one when running an MVC site which I had mucked around with the default routing, for the home page I was getting the default IIS page. Weird. I don't know where it is coming from or why but adding in a route with an empty URL

routes.MapRoute("Home"""new { controller = "Root"action = "Index"id = "" });

Seemed to do the trick! Again, not sure where this holding page is coming from, why it works fine in the built in server in VS 2012 etc. Currently I'm not overly impressed with M$ for mucking everything around like this, it just makes me sometimes wish I had picked PHP or Java all those years ago! Maybe...

Wednesday, 20 March 2013

Fixing Windows 8

After nearly 4 months with Windows 8 I think I can say I have given it a fair chance to show itself off and here are some of the highs and lows of my experiences.

My lowest point was a recent Windows Update automatic reboot which lost me 30 minutes of my life through closing a browser session where I had been filling in a long complicated insurance claim to automatically reboot to apply some updates. Windows 8 was meant to stop this but some research showed me that you only see the reminders on the login screen, which if you have a fingerprint reader you never see! So, despite the warnings having been in place for 3 days, I never saw them because I just swipe and go. The cure? From your Windows 8 Metro Desktop, type "gpedit.msc" and hit enter to open Group Policy Edit. Expand the following: Local Computer Policy > Computer Configuration >Administrative Templates >Windows Components >Windows Update - No auto-restart with logged on users for scheduled automatic updates installations, change the setting to enabled and you're all done!

My next problem was regular blue screens/crashes when recovering from sleep, the system would just lock up and I would have a black screen that wouldn't respond. This would happen every 2-3 days and there was no explanation in the logs. My guess was something to do with the hard disk but being a new SSD it was unlikely to be mechanical ;-) so I turned to the interweb again. One crash showed me something to do with 'clock watchdog timeout' so a quick google led me to this site. Having hunted down the relevant AHCI drivers from Lenovo that had been released the day before and installed I haven't had a crash since, fingers crossed!

The 'Metro' interface (called some other nonsense now) is something that still mystifies me and I haven't found a use for it, in fact it seems to make my life harder because every time I install something, all the notes, uninstall options, different sub applications each get a tile, so for one application there may end up being 5 or 10 tiles. Install 20 programs or more and that is a possible 200 tiles. Finding what you want isn't simple. The search is also hit and miss because you have to say if you want a Program or App. Is Windows Update a program or an App? I don't know, I honestly don't care, I just find it annoying that when I search for Windows Update it isn't there and I have to click again.  The Windows+X shortcut was useful but no replacement for the start menu with full search. The cure? Start8. It's perfect and makes Windows 8 finally a lovely thing to use...

Tuesday, 29 January 2013

Avast! ye landlubbers

Avast! internet security managed to make my laptop so secure that it couldn't connect to the internet. Very secure I suppose but not very helpful! Having installed it based on some articles I'd read on PC Pro about how I ought to have some antivirus installed rather than the basic package included with Windows 8 I thought I would give their top rated free recommendation a go. All seemed well, everything was working, it found a couple of ancient viruses that weren't really going to do anything but it seemed OK and wasn't hindering me. I managed to turn off the annoying voice and the popups after a little investigation and it seemed quiet... Until I got home from work and... nothing. 

I wasn't getting an IP address, no refreshes/renewals/reboots would do it. The only software I had changed had been Avast! so that was removed and I rebooted but still no internet! Grrr... So into the device manager to reinstall the network device in question (Intel wireless card) and there were many unhappy looking network adapters with the name - avast! at the end of them... Why these weren't removed when I uninstalled the software I do not know but they were all binned, then the real network device removed and reinstalled. and hooray, back online!

All with the backdrop of grumpy children, a short deadline and wind and rain outside I was feeling pretty grumpy but this experience has really put me off Avast! So beware ye landlubbers, this 'ere antivirus package might not be the most friendly for Windows 8 users! (I'll try a few more when I'm feeling less stressed).