AdventuresWith.Net | Dann Blackwell

I hate ASP classic. I hate it with a passion. AND THEN when your browser crashes every time that you go to debug it, you start building muderous tendancies.

Anyway, Found a solution. Hot fix to VS 2008 that fixes this and a few things that I didnt care about.

http://code.msdn.microsoft.com/KB967631

This QFE fixes three complete separate issues in the VS2008 SP1 Debugger:
- Debugger can hang the IDE after setting a breakpoint when working with a large C++ project
- Breakpoints do not bind correctly when an MSIL file is built containing .line directives
- VS crashes when debugging a classic ASP web and debugging is stopped.

,

Have watched a great presentation today from Scott Hanselman from the MIX 10 conference.

YOU MUST/NEED TO WATCH THIS!  -> Scott Hanselman presents the IIS Web Deploy

There were a few great ideas built in to his story, such as Web Deploy sitting on the back of a continuous integration setup and pushing out all the good stuff on successful build.

A problem I had while setting up Web Deploy was that there was no “Management Service Delegation” icon in IIS after installing the Web Deploy tool from the Web Platform Installer.

I solved it by downloading the actual install for the Web Deployment tool itself, then changing the setup so that IIS management items were installed. Voila! I have my icon:

image

Also, I had to add (for some unknown reason) an allow all IP range into my Management Service to stop 404 Errors.

image 

credit to AndyFraley @ IIS Forum – Web Deploy thread – http://forums.iis.net/t/1163109.aspx

No tags

Mar/10

30

Converting MVC 2 RC to MVC 2 RTM

Ok, this is more of a hack than a true conversion, but I haven’t noticed the difference… yet.

Remember to back up what you’re not willing to lose!

  1. Remove your MVC project from your solution. Don’t delete, just remove. Then save all (Shift-Ctrl-S)
  2. Edit your MVC project *.csproj file and change the ProjectTypeGuids to:
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>image
  3. Add your project back into your solution and save everything

,

I had started to get this annoying error when I ran my web app:

Exception has been thrown by the target of an invocation.

Simple fix. Add back those virtual keywords onto my POCOs that somehow disappeared.
public int Id {get;set}   –>  public virtual int Id {get;set;}

AS A NOTE – WEB DEPLOY IS MUCH BETTER THAN FTP PUBLISHING - Just letting you know :)

This is my quick guide ( i.e. how i did it) on how to get FTP Publishing working on a Amazon Instance Website.

  1. Install FTP Publishing using the Microsoft  Web Platform Installer
  2. Under the IIS Manager, go to the server and run through the FTP items one by one:
    1. FTP Authentication – I just used basic authentication, but you can roll your own.
    2. Authorization Rules – I added a “Allow All Users Read Write”. You can be more exclusive
    3. Firewall support
      1. Specify a Data channel range. I used 28000 –> 28100
      2. Leave the external IP address empty. Seems to work well
    4. SSL Settings – Choose your certificate and allow SSL connections (Used with Explicit SSL over FTP)
    5. User Isolation – I have this set to FTP root directory
    6. Setup the Windows Firewall to allow the SSL connections to actually connect by running this command (credit for this tip goes to learn.iis.net)
      netsh advfirewall firewall add rule name="FTP for IIS7" service=ftpsvc action=allow protocol=TCP dir=in
  3. Log into the Amazon Instance Manager or use Elastic Fox for Firefox (which is pretty cool) to access the security groups
    1. Add FTP port 21 with host 0.0.0.0/0
    2. Add the port range that you added before (e.g  28000 –> 28100) and set the host to 0.0.0.0/0
  4. Add FTP publishing to a specific site
    1. Right click one of your sites in the IIS manager and select “Add FTP Site Publishing”
    2. Add a virtual host name if you feel the need, or require it to differentiate.
    3. Customise at will or let the server defaults handle the settings, then click Finish
  5. Log into the site using a Windows login and  a good FTP client (e.g. like Filezilla) with the servertype as “FTPES – FTP over Explicit TLS/SSL” or if that doesn’t work, try just plain ol’ FTP (not recommended with a Windows Login). Hopefully there is no issue. If there is let me know what happens or how you fixed it if you did.

, ,

 

I found two new tricks to make all these things work together for debugging a Visual Studio Asp.Net web project on Localhost. Here they are:

  1. Disable IPv6 – This stops the “Fiddler: No connection could be made because the target machine actively refused it” message.  (Credit to Mike Ormand) This happens as visual studio will not allow external connections to the “test” server it creates, so all requests must be local.
    For some reason it treats fiddler IPv6 connections as external, and therefore nothing works through the fiddler proxy.
    fiddler_disableIPv6
  2. Instead of using localhost, use localhost.  <- notice the fullstop / period on the end of the localhost. This makes it look external, so the requests show up in your Fiddler GUI.
    image

And there you go! A working Fiddler session off the Localhost.

No tags

This is about Codility Candidate Testing

I just did a test on Codility and it’s great! In fact, this is sooo much than PreVisor (http://select2perform.com) which I had to use the other day.

You can write your code in any language (as long as its in Java, C#, C++, Javascript, Ruby, Pearl, Python, Pascal, C and I think a few more)

image

Maybe I like it because I did so well :)

image

 

You have a simple test system initially so you can check if your code compiles and fits the initial test. Then you submit it to the hard core tests which tries to break it, and you get a score.

 

The analysis is very cool:

image

And I know why i failed test 4. Should have used double instead of int. But that’s why you use TDD, ‘cause those mistakes are easily made. 

No tags

I needed the outlines of most countries for a simple GIS project that I’m doing. I managed to find a world simple shapes file from http://mappinghacks.com/ called TM_WORLD_BORDERS_SIMPL-0.2.zip

This was in a shapes format used by ARC GIS and the likes, but I needed it in an easy to consume manner i.e. XML

So taking it, feeding it through MapWindow GIS and a  shareware  plugin “Shape2Earth”  (a shapefile to KML converter) I received a KML file out the other side.

As it was a bit bloated, I built a console app using some hideous code turned it into a nice usable XML doc.

image

Here’s an example of the result showing the UK, France, etc, produced in DeepEarth:

image

Deciphering should be pretty easy. Here is the rundown:

A country has a name and ISO3 tag and one to many polygons.

Each polygon has one outer bound (outer island)  and zero to many inner bounds (inner islands) for where the country isn’t (as in Swaziland inside South Africa).

Easy stuff.  Here’s the zipped download:

Let me know where you use it!

There is no licence except where mappinghacks.com applies one, but I couldn’t see one there. Tell me if I’m wrong.

, , , ,

Just made a quick and dirty Ubiquity command for StackOverflow searches.

Download from GitHub:  Ubiquity StackOverflow Search 

Don’t know Ubiquity?

It’s like a Command Line for the web but… it’s really cool! Trust me. Watch the clip below. Sure it starts out dull, but then so does District 9. Then bam, explosions and stuff! It’s not 0.1 anymore either, so ignore that bit.

The link to get it is https://mozillalabs.com/ubiquity/
Then go to about:ubiquity and read the Commands. There are lots!

No tags

 

But how do you fix it? The weird thing is that to fix it, you install another program: Adobe Shockwave

Don’t know how or why, but it fixes the high CPU usage where Firefox sits at 99% or 100%

Strange huh?

You should probably update Adobe Flash while you’re at it anyway. Do it first, that way it’s all associated nicely.

Older posts >>