问题
how would I preset a Windsor configuration file parameter with an Enum specified entry such as "EntryType" below?
I currently have this:
<component
id="test.service" service=".." type=".." lifestyle="transient">
<parameters>
<entryType>EntryType.Test</entryType>
</parameters>
</component>
Where ..
obviously represents the full namespace and assembly.
But receiving this error:
Could not convert from 'EntryType.Test' to
Business.Common.Services.Core.TestService+EntryType.
回答1:
Written like this, it worked for me:
<component
id="test.service" service=".." type=".." lifestyle="transient">
<parameters>
<entryType>Test</entryType><!-- NOT EntryType.Test -->
</parameters>
</component>
来源:https://stackoverflow.com/questions/1629353/use-enum-as-parameter-in-windsor-configuration-file