Constructor Parameter Name

Jul 14, 2010 at 11:14 AM


I'm surprised about this:

I've configured in app.config a service reference constructor. This constructor is in a partial class file and has one parameter: System.Boolean inyectarCredenciales. When unity is loading configuration it fails reporting not found a parameter with name "inyectarCredenciales". Now most incredible thing: I rename parameter to "a", I reconfigure app.config and It works!!

For more information, I tried with other names: "credenciales" -> error; "c" -> works; "cred" -> works. 

How is this posible??

Jul 14, 2010 at 6:17 PM

The names have to match exactly - case and all. Another possiblity - is there a code page issue going on? Are there accents or tildes or any other non-ascii character in the name? In that case the C# compiler may have emitted one string but the config file loader may have interpreted it differently.

Just guessing here.

Jul 15, 2010 at 6:12 AM

Names match exactly, I'm sure. No tildes and non-ascii characters.

It's posible length of names are the issue?

Jul 16, 2010 at 2:01 AM
At this point I really need to see a sample that demonstrates the problem.