Wednesday, October 17

Visual Studio 2005 ASP.NET F5 Debugging performance

I was experiencing a delay of about a minute between pressing F5 to start debugging my ASP.NET application (VS2005 SP1, Vista) and anything appearing in the browser.

After researching this and installing various hotfixes, nothing improved. Removing the google toolbar however seemed to make debugging return to its normal speed.

Wednesday, September 5

ASP/ASPX pages giving 404 errors

In case I need to do this in future... I have been trying to copy a web site to a new web server (Windows Server 2003) and getting very confused about why .ASP and .ASPX pages were giving 404 errors, but HTML pages were displaying correctly. The reason was "ASP.NET" and "Active Server Pages" in the Web Service Extensions directory were both set to "Prohibited".

Wednesday, August 29

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

I was getting an error message "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." when trying to connect to an HTTPS site using an HttpWebRequest.

As the site I was connecting to was a test site from a 3rd party known to me, but not set up correctly at their end, to bypass this check I added the following line before calling GetRequestStream on my HttpWebRequest.


ServicePointManager.ServerCertificateValidationCallback
+= new
System.Net.Security.RemoteCertificateValidationCallback
(CustomValidation);


and added the CustomValidation function as follows:


private static bool CustomValidation(object sender,
X509Certificate cert, X509Chain chain,
System.Net.Security.SslPolicyErrors error)
{
return true;
}

Tuesday, June 12

InternalsVisibleToAttribute, Unit Testing and Strong Names

I previously posted about using the InternalsVisibleTo attibute for testing with NUnit.

I've had some problems building this with a stronly named assembly. I found the following post on Kent Boogaart's blog that describes how you should change the code in your assemblyinfo.cs file as follows:

[assembly: InternalsVisibleTo("Company")]

to

[assembly: InternalsVisibleTo("Company, PublicKey=xxxxxxxxxxxxxxxx")]

Adding a strong name to a third party dll

I've been trying to build an assembly with a strong name and had some problems as it referenced a 3rd party assembly which had been built without a strong name.

To add a strong name I disassembled and reassembled the 3rd party assmbly as follows:

ildasm /out:thirdparty.dll.il thirdparty.dll

ilasm /dll /resource=thirdparty.dll.res thirdparty.dll.il /out=thirdparty.dll /key=mykey.snk

Tuesday, June 5

World Environment Day

To celebrate World Environment Day, we have all been given a flowerpot, some peat and some forget-me-not seeds. You can follow whether the seeds grow into a beautiful plant or not here.