私は問題を解決するのに苦労しており、本当に助けに感謝します。Spring.Core.TypeMismatchException:型のプロパティ値を変換できません
public interface ISolver<T>
{
void Solve();
}
public class Solver : ISolve<IEntity>
{
void Solve()
{
...code that solves the given problem
}
}
public class Client : IClient<IEntity>
{
public Dictionary<string, ISolver<IEntity>> Solvers { get; set; }
}
すべてがネームスペースソリューションの一部です。 Spring.Net構成で
:
<object id="Client" type="solution.Client, solution">
<property name="Solvers">
<dictionary key-type="string" value-type="solution.Solver, solution">
<entry key="SolverMp" value-ref="SolverMp"></entry>
</dictionary>
</property>
</object>
<object id="SolverMp" type="solution.Solver, solution">
</object>
私は例外を取得:
Spring.Core.TypeMismatchException:型のプロパティ値を変換できません[System.Collections.Generic.Dictionary` 2 [[System.String、mscorlib、Version = 4.0.0.0、Culture =ニュートラル、PublicKeyToken = b77a5c561934e089]、[solution.Solver、solution、Version = 1.0.0.0、Culture = neutral、PublicKeyToken = null]]] [System.Collections.Generic.Dictionary`2 [[System.String、mscorlib、Version = 4.0.0.0、Culture = neutr PublicKeyToken = PublicKeyToken = b77a5c561934e089]、[solution.ISolver`1 [[solution.IEntity、solution、バージョン= 1.0.0.0、Culture =ニュートラル、PublicKeyToken = null]]、ソリューション、バージョン= 1.0.0.0、Culture =ニュートラル、PublicKeyToken = null]]]プロパティ 'Solvers'に対して。
私はあなたが 'ソルバーを意味すると仮定します。ISolver'先頭に、それはタイプミス –
annonymously