Ok, that's fine.
There are two parts to it. First of all the exception message you're
getting is misleading. In beta 2 and further on its actually:
Castle.MicroKernel.ComponentNotFoundException : Requested component
named 'watching.._bob.txt' was not found in the container. Did you
forget to register it?
There is one other component supporting requested service
'Foo.Bar.IFileWatcher'. Is it what you were looking for?
Second part of the issue is, as mentioned in the exception message,
you're trying to resolve the component by name, and there's no component
for that name.
This is a breaking change from v2.5.3 and as described in
breakingchanges.txt, if you want to fallback to resolving by type when
you can't resolve by name set
FallbackToResolveByTypeIfNameNotFound = true;
in your selector.
HTH,
cheers,
Krzysztof
On 30/09/2011 12:50 PM, Matthew Brubaker wrote:
public class FileWatcherSelector :
DefaultTypedFactoryComponentSelector
{
protected override string GetComponentName(MethodInfo method,
object[] arguments)
{
if (method.Name == "GetFileWatcher" && arguments.Length == 2)
{
var fileName = Convert.ToString(arguments[0]);
var scrubbedName = fileName.Replace('\\',
'_').Replace(':', '_').Replace(' ', '_');
return "watching.{0}".FormatWith(scrubbedName);
}
return base.GetComponentName(method, arguments);
}
}
--
You received this message because you are subscribed to the Google Groups "Castle
Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.