Tuesday, April 14, 2009

CLR Stored Procedure Static Exception

I was making a CLR stored procedure recently and had just added a Find Predicate to the code when the compiler gave me the message:

CREATE ASSEMBLY failed because method 'CreatProductTemplateSetTable' on type 'StoredProcedures' in safe assembly 'XyzAssembly.Database' is storing to a static field. Storing to a static field is not allowed in safe assemblies.

Turns out the find predicate isn't usable, but and Exists is. See Troubles with shared state and anonymous delegates in SQLCLR

Monday, April 6, 2009

Slingshot web hosting

Slingshot currently provide free web hosting with their internet services.

The section in their help page says:

If a domain name is required or for further support please email us at domains@slingshot.co.nz. Please allow for 2 working days for domain names to be setup.
There is no setup or connection fee for this service from Slingshot.

How do I setup and use my free Web hosting?

So I contacted them about how I could setup a CNAME entry to connect my domain to the hosting. Unfortunately they require full control of the domain to use it with their host. This is disappointing, but I guess it is "free" hosting.

Circumnavigating Pepin Island by kayak

Paddled out of Cable Bay and around Pepin Island with a friend last Sunday. The water was really clear in the bay. We timed the tides reasonably well and were able to paddle well into the inlet back to where we started from.

Wednesday, April 1, 2009

BadImageFormatException in IIS 7.0 on 64-bit Windows 2008

When hosting a WCF service in IIS 7 on my 64-bit Windows 2008 machine I got the following error:

System.BadImageFormatException: Could not load file or assembly 'APToolkitNET' or one of its dependencies. An attempt was made to load a program with an incorrect format.

To resolve this I had to set the "Enable 32-Bit Applications" ([enable32BitAppOnWin64]) to true on the applicable application pool.

See also:


I've also run into the same issue with the Application Pool for a Sitecore CMS 6 install.

Server Error in '/' Application.

Could not load file or assembly 'System.Data.SQLite, Version=1.0.48.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.48.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Prevent Skype using port 80 and causing IIS to throw a HRESULT: 0x80070020 Exception

The cmd NETSTAT -ano showed Skype (via the PID) was using port 80.

This was preventing IIS starting a local website with the message:

The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

This was resolved in Skype by unchecking Tools > Options... > Advanced > Connection > "Use port 80 and 443 as alternatives for incoming connections"