自从将
Windows 10更新到1803后,我已经开始接收此错误,只要我运行一个EF查询,该查询连接一个带有标量参数的表值函数.
Message: The incoming tabular data stream (TDS) remote procedure call
(RPC) protocol stream is incorrect. Parameter 2 (“”): Data type 0x00
is unknown.
Stack Trace: at System.Data.sqlClient.sqlCommand.<>c.b__180_0(Task1
result) at
System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute() — End of stack trace from
prevIoUs location where exception was thrown — at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.d__c.MoveNext()
我在.NET 4.6框架项目中使用Entity Framework v6.2.我验证了相同的代码在使用Windows 10 1709的另一台计算机上执行没有问题.我将计算机更新到Windows 10 1803而没有其他更改,我开始收到上述错误.导致错误的代码:
var query = from fs in db.ViewWithInformation
join e in db.GetEventsForPerson(personnelId) on fs.Event_Id equals e.Event_Id
where !fs.Is_Deleted
select fs;
return await query.ToArrayAsync();
如果我删除了针对db.GetEventsForPerson的连接,则运行查询.上面的EF查询生成的sql在SSMS中运行良好.
编辑5/15/2018:我已经确认这是由.NET Framework 4.7.2特别引起的.我在Windows 10 1709计算机上手动安装了.NET 4.7.2,错误再次启动.