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

Empty ClickOnce Error Message

Well, this error is pretty much the entire reason I decided to start my own blog. During the work day, I often look to the internet for the solution to errors or coding help. I feel I’ve become quite handy with google.com and rarely am I stuck with a problem for more than a few minutes.

Then I met this error. I even actually opened up an incident with Microsoft, something I once thought I’d never do. I’m not a Microsoft hater, nor do I doubt the answer was somewhere at Microsoft, perhaps by a lot of employees. But, I know how large corporations work, and it’s just frustrating working your way up the call ladder to get to someone who can actually help. I’d probably find a solution quicker by just formatting my machine and started from scratch.

Enough with the introduction, here’s the error.

At work I’ve developed an application that was to be deployed by clickonce. I published several versions and everything appeared to be working perfectly. We began to test the application on a wider range of machines as it came closer to application’s release date. It turns out that the ClickOnce applications that I was publishing, would not work on any machine that did not have all the prerequisites. If a machine was lacking any prerequisites, you could click on the “Install” button on the publish.htm but the user was instantly prompted by two empty dialog boxes.

error

 

As you can see, it’s very descriptive.

Anyhow, after some digging on the client machine, I did find an error in the Windows temp directory.

Error: An error occurred attempting to extract setup configuration file.
The following error occurred initializing the bootstrapper: “An error occurred attempting to extract setupconfiguration file.”

Google doesn’t bring up much on this error.

I had other developers try publishing the application after downloading it from source control. They had no problem publishing a working setup.exe. This problem was limited to my machine. So, I began creating new completely blank projects and immediately tried to publish them via clickonce. I got the same result each time. This problem was plaguing my entire machine, not just ClickOnce.

So, I started looking at the setup.exe my machine was publishing. Turns out my setup.exe was always 320kb. On the other development machines, they were 422kb. My setup.exe were a valid win32 image but, obviously they were missing something. I found out you could drag setup.exe’s into Visual Studio and examine them, so I did this:

badsetupexeresourceview

Bad Setup.Exe

 

 

And the good one:

goodsetupexeresourceview

 

Pretty major difference, right?

So, I searched my machine and found in previous projects my setup.exe were 422kb, so I had a time frame of where something went wrong. In one previous project I did a lot of work with certificates, so I spent some time trying to see if certificates were working on my machine, no luck.

Finally, I decided to remove a few programs each morning at work. (At the same time I was getting emails from my assigned Microsoft Tech telling me he thought it could be Firefox on the client machines). On the second day, I removed two programs: Microsoft’s WSE (Web Services Enhancements) 3.0 and .NET Memory Profiler Trial Version 3.0 by Scitech Software.

I loved the .NET Memory Profiler but my trial ran up and I even sorta forgot it existed, so I removed that. I still needed WSE but I was so convienced something with certificates had messed this up, I had to remove it.

Lo and behold after the removal of these programs, everything works again.

I reinstalled WSE and tried ClickOnce again, and everything was still fine.

I kept WSE and installed .NET Memory Profiler and my setup.exe was corrupt again. So, I’m somewhat certain that it was just the Memory Profiler but, I can’t say with 100%.

What I can say, is if you are having this problem, please remove WSE and any IDE add-on’s you have. Perhaps do it one at a time.

I let Microsoft know they could close my incident that although firefox on the client machines was a damn good suggestion (dripping sarcasm) but it was actually WSE or .NET Memory Profiler. I received a congratulations and was told that “WSE and ClickOnce is a known issue” Of course that pissed me off, I wish I would have been told that during the first phone call when I asked if anything could interfere with that.

Hope this saved someone out there some time that I lost.
UPDATE (3/14/08): Microsoft did refund my incident here. So, no harm no foul. Perhaps I’ll try their support again one day.

UPDATE (11/13/08): I’ve been using clickonce nearly daily since this incident and not one problem since. I have recieved some feedback from other people with this same issue, and it always seems to be solved by uninstalling some plugin software to visual studio. So, I believe the ultimate answer to this issue is to remove your plugins one by one.