The specified cast from a materialized 'System.Guid' type to the 'System.Int32' type is not valid.
我们有几个WCF服务,其并发模式为Multiple和InstanceContextModeSingle.我们的架构侧重于使用基于构造函数的依赖注入的松散耦合模型.这反过来是使用Unity 2.0实现的(每个服务的web.config都具有在统一容器部分中定义的接口和类型之间的映射).我们的依赖项之一是使用Entity Framework 4与MSSql Server通信的DAL程序集(数据访问层).与数据库通信的类也包含在单位映射中.
当我们运行集成测试时,一切都很棒.但是当我们转移到我们的性能环境来运行负载测试(2,3,4个并发用户)时,我们开始看到以下错误:
System.InvalidOperationException: The 'auth_token' property on 'Session' could not be set to a 'Int32' value. You must set this property to a non-null value of type 'Guid'.
使用以下堆栈:
at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at System.Data.Common.Internal.Materialization.Shaper.GetPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
at lambda_method(Closure , Shaper )
at …Run Code Online (Sandbox Code Playgroud)