Wednesday, December 03, 2008

Sitecore Packager throwing System.IO.IOException: The file exists.

Just had a bit of a curiosity when attempting to create a package using the Sitecore Packager.
Essentially it would give up on me, and tell me that the file existed. Stacktrace revealed:

[IOException: The file exists.] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +2056933 System.IO.__Error.WinIOError() +30 System.IO.Path.GetTempFileName() +2715024 Sitecore.Shell.Applications.Install.Commands.BuildPackageCommand.Execute(CommandContext context) +106

And so on. So looking at this, turns out the packager isn't really to blame here. Except maybe for the fact that it should have cought this exception and given a better error message :P

Looking into my C:\WINDOWS\TEMP folder revealed:

And further looking at MSDN reveals:

The GetTempFileName method will raise an IOException if it is used to create more than 65535 files without deleting previous temporary files.

The GetTempFileName method will raise an IOException if no unique temporary file name is available. To resolve this error, delete all unneeded temporary files.

A bit of housekeeping, and voila

All good again :-)

Thursday, September 25, 2008

CorePoint.DomainObjects Update 1

Just posted a minor update of CorePoint.DomainObjects onto Sitecore Trac. Not much new under the sun, a bug fix and a few simple helper methods. 1) It is now possible to create a field such as: [Field("myImageField")] public Sitecore.Data.Fields.ImageField MyImageField { get; set; } This was always the intention, but implementation was faulty. It now works - knock on wood ;-) 2) StandardTemplate knows a couple of new tricks. .IsAncestorOf and .IsDescendantOf. They have similar functionality as Sitecore's own versions of same methods. Update 1 for Sitecore 5 Update 1 for Sitecore 6 Enjoy :-)

Monday, September 22, 2008

Update-3 (080912) Released

While doing my rounds on SDN I came across a new update for Sitecore 6. Unfortunately it doesn't appear to fix many (if any) of the issues that has been noted - some of which are showstoppers in my opinion - but it's better than nothing I assume ;-) Hopefully the list of known issues will diminish and we'll see Sitecore 6 reaching bug convergence this year.

Tuesday, July 15, 2008

Return to the not-so cacheable Control in Sitecore 5.3

Ok so,
It would appear that my previous post on this subject somehow managed to misdirect the focus from what was the original intention; point out the very troublesome issue of Sitecore Support's policy of recommending Sitecore 6 upgrades for Sitecore 5 problems.
The issue at hand was that of a certain Control not being cached. Well it was, but the code was also executed. Although asked specifically for workarounds, no alternatives to the upgrade route was presented. A short while spent in Reflector, a few config files and so on, leads me to believe there could be a workable solution.
This has NOT been tested outside my sandbox testing environment however, any feedback would be appreciated.
The "CachingEnabledControl". Inherit from this one and your work is 90% done.
Now all you need to do, in top of your CreateChildControls() method, is check if Sitecore has a cached copy of your control that it intends to show.
public class MyCacheableControl : CachingEnabledControl
{
 protected override void CreateChildControls()
 {
  if ( IsSitecoreCached )
   return;

  // Normal functionality here
Given the same setup as described in the original post, we now no longer incur the long delay (.Sleep()), and Sitecore outputs it's cache just fine.
Please DO keep in mind, this is probably UNSUPPORTED and MIGHT NOT WORK FOR YOU AT ALL - for whatever reason :P
Here's the source file. MyCacheableControl.cs