Wednesday, 18 June 2008

UK Postcode Regular Expression

Very useful: ^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$

REF: http://regexlib.com/REDetails.aspx?regexp_id=260

Monday, 9 June 2008

Build (web): Object '[...].rem' has been disconnected or does not exist at the server

We had this constantly during a build (during the validation part) of a web application in Visual Studio 2008.  I think it occurred just after the machine name changed, but cannot be sure.

We also got the error 'The application domain in which the thread was running has been unloaded'; but only once.

We opened a Microsoft Support case for it - they managed to suppress the error by putting the following in the web.config

<system.codedom>

<compilers>

<compiler language="c#"

type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" extension=".cs" compilerOptions="/nostdlib /d:DEBUG;TRACE /warnaserror-" warningLevel="0"/>

<!-- /nowarn:0162,0108,0114,0252 -->

</compilers>

</system.codedom>

Under "configuration".

We're still waiting on a response from MS Support and we believe it's an MS bug.  At least with the above, it's possible to get on with the job!

Kris

UPDATE: 25TH JUNE 08:

OK, this bug has been sent via Redmond and I had a response today: "As a follow up to your question below… We investigated this area and it came out to be a known bug which we are fixing in SP1 version of ASP.NET…  So do ask Kristan to look forward to it".

Visual SourceSafe Internet

Over the weekend I tried to get Visual SourceSafe Internet working so that i could work remotely on projects via HTTPS.

My server is Windows Server 2003 with IIS 6.0 and VSS is v. 2005 (incidentally there is a service pack available for VSS 2005, although they've called it a GDR [general distribution release] and it's available here)

Normally you should be able to use the VSS Admin tool's "Configure" option to publish the database on the Internet.

Unfortunately, I spent 5 hours trying to get this to work.  I got so far as enabling SSL, remotely browsing to the correct VSS project in the project tree and doing a Get Latest, but whenever I checked anything in I would get "There was a failure uploading the URL" etc; "Do you want to retry the operation?"

I used Fiddler to try to debug what was actually happening, and it translated as a "403.3 Forbidden" from IIS.  This would normally mean that write access is denied, but the application pool identity and the IIS anonymous authentication identity both had full access to the VSS temp upload directory.

The check-in mechanism of VSS Internet appears to use WebDAV underneath; so you need to ensure the WebDAV extension is enabled on the web server in the IIS Admin tool.  Also, need to ensure that the PUT HTTP verb is accepted.  If URLScan is installed (this seems to help lockdown the http verbs that iis can accept) then you need to ensure the PUT verb is inside the AllowedVerbs section of the urlscan.ini (system32\inetsrv\urlscan).

All this, plus, giving the Everyone user full read/write privileges to the VSS upload dir, did not work.

Write Access is Denied.

hmmmm as a last resort, I downloaded the IIS metabase explorer (in the IIS 6.0 resource kit) and changed the id from the website from 2350, to 1; and changed the one that was "1" to "2351"!  I did this because the VSS Admin tool tries to enable the database on the website with the ID of "1".   I then deleted any virtual directories in any Web Applications/Websites called "SourceSafe". 

Then I tried the VSS Admin tool.  It interacted with the correct website.  This seemed to work.  Whatever magic the VSS Admin tool weaves - it worked - provided that the website id of the website that you wish to enable  source control on is "1".

I can honestly say, I have no idea what was really wrong, however, my experience has been:

  • VSS is generally a poor product at the best of times
  • WebDAV is equally dodgy.  It seems the IIS team don't talk with the WebDAV team.

It's also my view, that MS should have tested this a hell of a lot more... the problems are prominent and totally reproducible!

So the motto of this story is; get the VSS Admin tool to set up the Internet database access, but make sure that the metabase id of the website is 1 beforehand.  I think you can then change it back if you want, although i haven't done this.

Once VSS Internet is configured, it seems to work OK.  If you're using Windows Vista and VSS 2005, make sure you install the GDR ("service pack") so that the VSS UI works properly inside Visual Studio 2008.

For general guidance, see this.

Kris

SQL Server Edition

SELECT @@VERSION
will do the job