Error:Function IsEnabledFor is not correctly.

Topics: CAB & Smart Client Software Factory
Nov 4, 2006 at 9:49 PM
originally posted by: geniusleft

Hi all.

I have met a exception when I try to create a view via guidance package it is said that:
An exception occurred during the binding of reference or execution of recipe CreateView. Error was: Function IsEnabledFor is not correctly implemented because it threw an exception. You can remove the reference to this recipe through the Guidane Package Manager.

My OS is Vista RC1, and VS 2005 + SP beta1 + VS SDK 3.0, while it was running OK previous days.

Any words are appreciates. Thanks.
Nov 4, 2006 at 10:54 PM
originally posted by: marianoszklanny

Could you please provide more information about the exception? Does VS give you more details about the error?

What version of SC-SF are you using?
Are you using a solution created with the Smart Client Application template?

Mariano Szklanny
Nov 5, 2006 at 12:08 AM
originally posted by: geniusleft

Hi Mariano, thanks for your attention.

The error info I gotten all in here, and I use the final version of SCSF and the solution is created by the template.

I think I catch the problem now.

I have create a new SCSF template solution and It's running well, while the old solution raised exception on which I have recalled the changed details, I think that's why the solution go exception.

I controlled the old solution under TFS, while the old solution originally cannot pass on Team Build server but can build success on local machine, the build log on Team Build said that missed project references so cann't generate right compile statement, I found the referenced project GUID in the failed project's .csproj file is unequal with the original project GUID, then I have fixed the project GUID sync in the failed project .csproj file in Notepad, and it can pass Team Build but cannot create view through Guidance on the project now.

Hopes the details can help you get the focus.

Nov 5, 2006 at 12:40 AM
originally posted by: marianoszklanny

The View recipe needs your project to have references to the following items:

- Microsoft.Practices.CompositeUI assembly
- Microsoft.Practices.ObjectBuilder assembly
- Infrastructure.Interface project

If you don't have this references, you won't be able to execute the recipe.
If you have the references but you can't still see the View recipe, it's because you:

a. Defined the assembly name of the Infrastructure.Interface project to be something different to 'Infrastructure.Interface'.

In this case see my post in this thread:


b. Have the wrong SC-SF settings in the .sln file. See my post in this thread:

Let me know if this helped.
Mariano Szklanny
Nov 5, 2006 at 4:04 AM
originally posted by: geniusleft

Thank you Mariano, The reference B is very useful.

Indeed, I have compared the source code version on local with source repository and merged the confilicts of the project files and solutions just now, but CreateView is still failed, I have noticed the big difference of .sln file by VerDiff tool also.

I must miss in somewhere and have no patience so I revert the total soloution to original version then add the last version code to the original version proj files and sln file, it's fine now.

I have to admit this error is raised by my uncorrectly changes.

But the original version code generated by SC-SF template can not pass the Team Build is really a bug, may be it's MSBuild's bug. Previously I have rechecked the team build buildlog.txt and found that after completed getting sources it is warning as follow:
• Solution file warning MSB4051: Project {3ED6DFEE-837E-4A55-B2E4-A044D77223D1} is referencing a project with GUID {BE39A9ED-D4C6-42E7-91D6-63D9B1D185C6}, but a project with this GUID was not found in the .SLN file.

That’s why missing project reference when on team build, I guess MSBuild using project reference with GUID when build on remote server but using project reference with location when build on local server, while SC-SF template modified the GUID mapping so TeamBuild failed. Anyway, it must be a compatible issue with Team Build and SC-SF, in my opinion.

Thanks for you kindly helps again. :)