Icon

First Days of AnkhSVN

Where I’ve worked we’ve been long time Visual Source Safe users. Everytime a new version of Visual Studio would come out, we’d quickly grab it from Microsoft, cross our fingers, and pray for a new version of Visual Source Safe.

It never came. Rarely did they even slap some lipstick on it.

So, we’re moving out of the slums. This week a Ubuntu 8.04 virtual machine was created (that’s a story for another day) and we installed the latest copy of SVN.

We toyed with the idea of running SVN and Apache on a Windows Server, but if you’re going to do something, you might as well do it right. Cue Mike Holmes.

Anyhow, for those few VSS users out there, so far we like AnkhSVN. I’ve got a copy of TortoiseSVN, but right not that’s just too far away from what I’m used too.

It’s nice to not have to ask someone to check in a file to make a quick chance. It’s nice to know we can FINALLY do some branching. We’re excited, but a little timid. I’ve had no luck getting our webservices into SVN, since the solution file exists seperate of the webservice itself. Right now I’m going to sit on this issue till I know a little more, but this will have to be solved.

I did run into one issue, when I moved my project from VSS to SVN and then to AnkhSVN, everytime I tried to save in Visual studio I kept getting a cannot save this file is write-protected. And it didn’t look like an IDE message, it looked like it was from Ankh. The internet was no help, nor were their forums. Finally, I wondered, maybe these files are still set read-only from their fiefdom under VSS. They were. I went through each of my local files, removed the read only flag, and I’m back in SVN bliss.

It wasn’t an easy journey with getting the SVN server up on a virtual machine, but things are looking up.

Oh, by the way! I tested both AnkhSVN and TortoiseSVN for the dreaded Empty Click Once bug, neither caused any trouble so far.

ClickOnce Cert Expired Issue Solved By RenewCert of May.be

Yesterday, I went to publish a new version of our clickonce application, when I was greeted by a message that Visual Studio wasn’t going to let me publish, because our certification had expired. Oh no.

We’d often talked about getting a real certification and not using the temporary one, but we never saw the real benefit, and now in hindsight, I’m really glad we did not.

So, here’s the problem:

After your first clickonce publish, Visual Studio creates a certification key file, and stores it in your project as “ProjectName_TemporaryKey.pfx”. As far as I can tell, this is used only to sign the manifest it’s never sent to the client. The only visible downside is when installing the application, it warns that it’s an unknown publisher. This temporarykey, like actual keys are good for one year from the issue date.

Once that year is up, you can’t publish anymore. If you change certs, your updates no longer work (The deployment identity does not match the subscription. ) and everyone has to reinstall the application. It seems that Microsoft acknowledges that this was by design but it was bad design, and I believe it’s much better in VS 2008.

So panic sets in, we talk about abandoning clickonce, how to get these updates to people in the mean time. We found a knowledge base article, which offers two work arounds. http://support.microsoft.com/kb/925521

The first work around is out of the question, if we do that, we get rid of clickonce for good.

The second work around, sounds confusing and I feel like we get one shot, if that doesn’t work the project is gone.

Then, I find my new favorite website: http://www.may.be/renewcert/, A wonderful person, Cliff Stanford, seems to have encountered this problem, and took Microsoft’s Workaround #2 and made it better and offered some real help.

I downloaded his version of renewcert, and tried it on one of my temporarykeys. I used the following command at first: renewcert MyProject_TemporaryKey.pfx MyProject_FiveYearKey.pfx CN=”My Company” super_dooper_password

It failed.

I got the following error:

PFXImportCertStore failed with error 0×56: The specified network password is not correct.

I didn’t see any mention of this on Cliff’s site so I started to get worried again. Decided to try again, this time, I looked at how the temporarykey was issued.

renewcert MyProject_TemporaryKey.pfx MyProject_FiveYearKey.pfx CN=”MYDOMAIN\MYUSERNAME” super_dooper_password

I had no clue what to use as password, my current domain password? The one from a year ago? I did some googling and found that when VS creates these certs, it doesn’t use a password, so I left it off:

renewcert MyProject_TemporaryKey.pfx MyProject_FiveYearKey.pfx CN=”MYDOMAIN\MYUSERNAME”

It worked! I went into VS, went to the Signing Tab in the project properties, did “Select From File”, picked my new fiveyear cert. It added it to the project for me, and extened my expiration date to 2013!

IF we would have used a real certification, I think we would have been in trouble. You would need your certification agency to issue you a new cert every year, but it would have to use the same key. This isn’t something they do often.

So, we’re going to keep on keeping on, and migrate off of ClickOnce eventually, but atleast we were bought some time. I’m suprised this issue only cost me about an hour of my time, and a little worrying.

Thank you Cliff Stanford of may.be

IE7 – Webbrowser Control breaks select tag functionality

Found a real frustrating one today:

My application is a blend between a web app and an actual windows form application. You can either access the web app or the windows form app. A few of the more complex features are only available to you if you run the windows form app.

To share features between the two, I just embedded a web browser control on a tab, and I have it bring up the web application.

Everything has always worked great, until I upgraded a test machine to IE7. Turns out all of my dropdown boxes (select tags) inside the application’s web browser control stopped working.

So, to recap, my dropdowns work in IE7, IE6, Firefox, but they don’t work inside my application which is using IE7’s Web Browser Control.

I found the offending piece of code that I had to remove. We were doing a little style to the select boxes when you clicked on them, apparently this version of IE7 did not like it.

Offending Code:

function colorChanger(obj)
{
if (obj.style.backgroundColor == '#f00')
{
return true;
}
else
{
if (obj.style.backgroundColor == '')
{
obj.style.backgroundColor = "#eeeeee";
}
else
{
obj.style.backgroundColor=(obj.style.backgroundColor=="#ffffff"?"#eeeeee":"#ffffff");
}
}
}

I used this code like this: