Tuesday, October 7, 2014

Repairing .NET 4.0 in Visual Studio 2010

I recently had problems installing security patches to the .NET 4.0 runtime, you know, the kind of problems that give you an absolutely generic installer error that leads absolutely nowhere.

Anyhow, I tried uninstalling .NET 4.5 and 4.0 completely and re-installing them - great, all fixed except for one problem - Visual Studio 2010 could no longer target .NET 4.0 (much less .NET 4.5+.)

Repairing Visual Studio didn't fix it, a whole slew of inane ideas and attempts didn't fix it - ultimately I found a guy who had a way that DID work for me that was short of uninstalling and installing Visual Studio again.

Just install the "Windows Phone Developer Tools" from 2010 (Web Installer.)  Running it will download all of the components and then it will begin installing, the second thing it installs is the .NET 4.0 multi-targeting pack.  As soon as that second item finishes installing just cancel the install - it won't roll you back.

Presto!  Visual Studio now recognizes .NET 4.0.

Thank you Xander Hyde wherever you are! -> http://tinyurl.com/qhtok24

Friday, May 23, 2014

Mono / Unity3D C# HTTPS HttpWebRequest Asynchronous craziness

Beware, ye crabby developers, of using HttpWebRequest asynchronously with SSL connection because there appears to be some crazy bug that causes a timeout (defaults to 100 seconds if I recall correctly) that yields a null response.

I spent the entire morning (and I ran into this previously on iOS a year ago and put it aside for a day when I felt like bashing my head against rocks) wondering why some simple asynchronous download management code I'd written work wonderfully for FTP and HTTP but then nothing seemed to happen when using a URL with HTTPS as the protocol...

I did the usual things like ASSumed it was a self-signed cert issue so I overwrote the certificate acceptance code - no luck.  I spent a bunch of time trying to understand the error messages I was catching on exception, ultimately tracing it down to a timeout on the OTHER end of the connection yielding a "connection forcibly closed" which told me that my server was actually saying "look meathead, if you're just going to sit on the line I'm going to cut you off so I can help someone else..."

So, I started Googling.  An hour later after reading about a ton of other people having this issue (but nothing mentioning 'debug') I caught a little bugzilla entry mentioning 'odd behavior' with HttpWebRequest when running in DEBUG.  So, having exhausted all rational attempts to resolve the issue I said "screw it, let's see if it works in release, guffaw, chortle..."

Bang, 8 simultaneous HTTPS downloads worked like a charm.

Un-FREAKING-believable.

So, if you too have crazy HTTPS issues that defy reason and you're using Mono/Xamarin/Unity3D, give your friendly neighborhood release mode build a try and see if it magically solves your ills.  I know mine did.

Hey Mav, do you still have the number of that truck driving school?  Truck Masters I think it was called...

Tuesday, April 29, 2014

WordPress Multiple Install IIS URL Rewriting Problems

Okay...  This has given me a gigantic headache (both figuratively and literally) all morning and thank goodness I've finally managed to hack a solution to it...  Technically it isn't a hack, but it sure smells like one.

We have an unusual situation where sales & marketing has its own WordPress installation at the root of our website and the support group has its own separate installation under /support.

The web server that we're currently using is an IIS 7 server, which means that WordPress is operating with no .htaccess files and using web.config.  Each base directory has a web.config.  Each WordPress is using its own Database and has its own database user.

So...  Problems arose when enabling permalinks (pretty ones) for the support site.  I couldn't figure out why going to any of the site pages was yielding a 404 error (emitted by WordPress' PHP.)

My hosting provider couldn't figure it out either - which really got me worried, so after slogging around endlessly, and reading about all the other people using multiple installs and having minor configuration issues, I really started to pull my hair out lol...  I then ran across an obscure post about a guy mentioning WordPress and ASP.NET configuration inheritance issues.  This led me to other posts about nested ASP.NET applications issues, which ultimately led me to the following magic:

<location path="." inheritInChildApplications="false">

Thanks to the wonderful person found at:

http://articles.runtings.co.uk/2010/04/solved-breaking-parent-webconfig.html

Basically, IF you have a WordPress installation in a sub-directory of your website that is hieararchically a child of another WordPress installation, and you're on an IIS web server, you need to edit the root WordPress installation's web.config file and surround it with the location element.

After doing that, my permalinks started working again just fine.  (Thank G-d...)

Tuesday, April 8, 2014

Visual Studio 2010 Web Publish over FTP

It seems like you can't use TLS or SSL to protect your FTP data when publishing from Visual Studio, but I just found out that you can.

There's no direct "FTPS" publishing mode, you simply select "FTP" and then make sure you use the correct protocol in the URL (i.e. "ftps://ftp.mysite.com/somefolder")

Many people probably knew that but I didn't...

Tuesday, April 1, 2014

Wide Fit Soccer Cleats (Boots) - Nike CTR360

I have wide, flattish, feet and love to play soccer - and this can be a problem when you're feet are size 12 1/2 to 13.

I've taken to wearing turf shoes the past two seasons because they're so much more comfortable than regular cleats - even Copas (which stretch well, but have a really narrow plate) are a problem as they are fine during the game but the next day my feet really hurt...

Luckily I was browsing Nike's website to see if they had any wide-fit boots now (almost nobody does) and lo and behold - they have a customizeable boot called the Trequartista III that comes in a wide fit.

Nike CTR360 Trequartista III FG iD (Wide) Men's Firm-Ground Soccer Cleat

You have to order direct from Nike's online store, and they're not cheap at $135, but you get to customize the studs, plate, upper, tongue, laces, et cetera - but most importantly they have 12 1/2 WIDE fit.

Thank God...  Sadly you have to wait 25 days while they make them and ship them to you though...

Mine will look like this:


Let's hope they fit well :).

BTW, the link to order is:

Thursday, January 9, 2014

SkyDrive is a pretty cool free app with a fair amount of free storage, but I really don't want to sync files by dumping them in the SkyDrive folder - so...

I tried simply making a soft link to the folders I wanted sync'd on my drives and it turns out that it works just fine.

mklink /D "C:\SkyDrive\MyFolder" "C:\SomeLocation\MyFolder"

You need to be running a command shell with Administrative privileges before you execute that.

The example above presumes that your SkyDrive folder doesn't already have a "MyFolder" link or folder in it, and when it runs, a soft symbolic link will be created in the SkyDrive folder that resolves to the actual folder location outside of the SkyDrive.

I currently share files between two PCs and an OSX box (yes, SkyDrive is on OSX too) this way before they qualify to be put into source control...