Dev Blog - Johan Danforth
I'm Johan Danforth and this is my dev blog - a mix of .NET, ASP.NET, Rest, Azure and some other random coding stuff.
-
Visual Studio 2008 Web Test Not Recording on 64-bit Windows 7
I was about to record a web test in Visual Studio 2008 Team System today, and the recorder refused to record anything. And the Recorder “bar” in IE 8 was not showing. After some digging around, the issue was fixed by deleting a few registry keys. Found it on Michael Taute's Blog : Diagnosing and fixing Web Test recorder bar issues.
Quote from his blog page:
Vista caches the list of explorer bars you have available and the recorder bar was not included in your list. The fix is to force Windows to rebuild that cache. To do this, first make sure you have all Internet Explorer instances shut down, then open the 32 bit registry editor and delete the following keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\Component Categories\{00021493-0000-0000-C000-000000000046}
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\Component Categories\{00021494-0000-0000-C000-000000000046}[Note: by default, the 32 bit registry editor is located in %WINDIR%\SysWow64\RegEdt32.exe]
The next time you boot Internet Explorer, your explorer bar cache will be rebuilt and the recorder bar should be available.
-
Windows 7 RC Feels Very Stable
I upgraded to Win7rc as fast as I could from the beta and pretty much all the problems I had on the beta are gone! I’ve never experienced a beta OS as stable as this one, it’s nothing short of impressive.
Hangs on reboot/shutdown are gone.
Annoying stuttering sound probs are gone.
File copy probs are gone.
Screen update probs gone.
I’m running 64-bit on a DELL Precision M4400 and the funny thing is that think I’ve not installed any extra drivers except for the touchpad and the initial network drivers, and it runs like a charm. It was a nightmare to get it working properly on 64-bit Vista, even when it came pre-installed with it from DELL! (Shame on you DELL to ship a box that doesn’t even run properly on the pre-installed software!!)
I will have to install the extra software to get the built-in 3G mobile network running and that was kind of tricky on the beta, and the finger-print reader I’m not even going to bother with.
-
Windows 7 Release Candidate Availability
Glad to read about the upcoming RC release of Windows 7. Just wondering how I should “migrate” to the RC from by current beta as I’ve spent days and days to get it in pretty good shape. Lots of job, but Win7 is just worth it.
From the Askperf webby:
We now have some dates that we can share with you. The RC build is slated to be available for download by MSDN / TechNet subscribers this Thursday (April 30, 2009). Broader, public availability will begin the following Tuesday (May 5, 2009). If you haven’t already started using Windows 7, there are plenty of changes since the Beta release. You can read more about these changes in the following posts from the Engineering Windows 7 blog: Some Changes Since Beta for the RC and A few more changes from Beta to RC…
-
Restored 64-bit Windows 7 Beta from Windows Home Server Backup on a DELL Laptop
The HD of the new DELL Precision M4400 I have crashed, burned and died yesterday. I heard the screams 3 rooms away while drinking my morning coffee. It was horrific.
Luckily it was powered on during the night, so the Windows Home Server (WHS) had a full backup. Had a few probs though:
- the recovery cd didn’t have network drivers for my LAN card
- the drivers stored in the special folder on the backup were 64-bit, which isn’t supported by the recovery cd (DUH!!)
- had to download 32-bit drivers from DELL and put on USB drive
Tip: make sure your c-drive matches the size of the backup, and create a “dummy” FAT recovery partition on your new HD which mimics the DELL RECOVERY partition. Also, make sure your USB drive is disconnected once you don’t need it anymore. Make sure it’s disconnected before you finish the backup. Also, eject the recovery cd when rebooting, just to be sure! I had to do the restore 3 times before it managed to make my c-drive bootable! Quite annoying…
-
7-Zip on 64 Bit Windows 7 Beta
I’m having problems in my 64 bit Windows 7 beta with the built in support for unzipping zip-files containing *lots* of files. It often hangs near the end and I have to reboot to sort things out.
Downloaded 64 bit version of 7-Zip and it work fine – so far. You might want to try that one out if you have the same problems. Eventually it may also hang, but I’ll try it for a while and shout out if I notice any probs.
-
Writespace in Other Languages
Some time ago I noticed a peak in Writespace downloads and I started to get some emails from people with requests for new features and stuff, which is fun. I saw from the stats that Lifehacker had a couple of articles on Writespace, as well as Danish PC-World, some Japanese site (I have no idea what the site is about :) and a few other places.
I had no idea if Writespace actually worked in Japanese, but apparently it does!
Lifehacker.com Pcworld.dk Moongift.jp If I get some time for it I’ll release a Word 2003 version and add a few of the requested new features.
-
Fill a Select/Option from Json with jQuery
More jQuery and Json…
To fill a listbox (select) with items from a Json call.
I got this helper class to handle the options/items:
public class SelectOption { public String Value { get; set; } public String Text { get; set; } }
A sample action/method in ASP.NET MVC that returns Json:
public JsonResult GetJson() { var list = new List<SelectOption> { new SelectOption { Value = "1", Text = "Aron" }, new SelectOption { Value = "2", Text = "Bob" }, new SelectOption { Value = "3", Text = "Charlie" }, new SelectOption { Value = "4", Text = "David" } }; return Json(list); }
Some HTML and jQuery to fill the list at page load:
<select id="MyList" /> <script type="text/javascript"> $(document).ready(function() { $.getJSON("/Json/GetJson", null, function(data) { $("#MyList").addItems(data); }); }); $.fn.addItems = function(data) { return this.each(function() { var list = this; $.each(data, function(index, itemData) { var option = new Option(itemData.Text, itemData.Value); list.add(option); }); }); }; $("#MyList").change(function() { alert('you selected ' + $(this).val()); }); </script>
-
Json, jQuery and ASP.NET MVC
I’m stacking a few things here related to Json, jQuery and ASP.NET MVC so that I can get to them later on.
JQuery to grab some Json when a web page is loaded:
$(document).ready(function() { $.getJSON("/MyController/MyJsonAction", null, function(data) {
//do stuff with data here
}); });The smallish code in the ASP.NET MVC controller:
public JsonResult GetJson()
{
return Json(GetList());
}
It’s possible to use anonymous types with Json() as well, which is very useful but may be harder to unit test.
-
WCF Certificates with IIS on Windows 7 Beta
I’ve blogged earlier about the problems with Cassini and WCF on Windows 7 Beta (build 7000) and your best bet is to install IIS locally test your services in there. Now, there might be some problems getting IIS to read your service certificate and my colleague Tomas helped me get things running. I thought I might as well blog it here so that I got it documented…
Open a VS2008 Command Prompt (I ran it as administrator) and create a certificate, then add it to your local store:
makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=localhost -sky exchange -pe
certmgr.exe -add -r LocalMachine -s My -c -n localhost -r CurrentUser -s TrustedPeople
Then you have to give IIS access to the private part of the certificate and Tomas found some sample code to let you do that. The FindPrivateKey.exe source code is available on MSDN. Keep working on the command prompt:
FindPrivateKey.exe My LocalMachine -n "CN=localhost"
Note the output for private key directory and filename, for example:
Private key directory: C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys
Private key file name: 288538e27a2aebe9f77d2506bf6c836a_adf55683-4eae-4544-bbd1-d6844a44e538
Then use them to feed the final call to give the default IIS-user access to the private key, for example:
CACLS.exe C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\288538e27a2aebe9f77d2506bf6c836a_adf55683-4eae-4544-bbd1-d6844a44e538 /G "IIS_IUSRS":R
That should be it, and it worked on our machines.
-
Running ASP.NET MVC on Your Windows Home Server
Right, so I ran the new Web Platform Installer 2.0 Beta on my WHS and it seems (so far) to have worked out quite well. I created a new MVC website with File->New… and published it over to an MVC-directory on WHS (I have set that up earlier, with a file share and everything).
Now, the version of IIS on Windows Home Server is IIS 6 (because WHS runs on Windows 2003 kind of), so ASP.NET MVC won’t work right out of the box. I was hoping that the Web Platform Installer would have taken care of that, but apparently not.
Phil Haack wrote a long, and very detailed blog post about how to set things up on IIS 6, so I’m following that, adding support for the .mvc extension, changing the routes in Global.asax and so on, and voila it works:
Now, I want to set up extension-less URL’s, which is prettier than having to have that .mvc extension in the URL. Phil cover this in his blog post as well, so I’m adding wildcard mappings, and here goes:
Isn’t that just great? I love my home server, maybe I can host my Writespace Clickonce installer on my own server? Not too worried about the load on the server :)
Watch this space for some sample stuff that will be located on my own server *big grin*