首页 新闻 会员 周边

C# MissMethodException

0
悬赏园豆:5 [已解决问题] 解决于 2020-07-28 16:53
ex.Message
找不到方法:“System.String System.String.Format(System.IFormatProvider, System.String, System.Object, System.Object)”。
ex.TrackStack:

在 Microsoft.CSharp.RuntimeBinder.Semantics.BSYMMGR.GetNameFromPtrs(Object u1, Object u2)
   在 Microsoft.CSharp.RuntimeBinder.Semantics.BSYMMGR.GetNsAid(NamespaceSymbol ns, KAID aid)
   在 Microsoft.CSharp.RuntimeBinder.Semantics.BSYMMGR..ctor(NameManager nameMgr, TypeManager typeManager)
   在 Microsoft.CSharp.RuntimeBinder.Semantics.GlobalSymbolContext..ctor(NameManager namemgr)
   在 Microsoft.CSharp.RuntimeBinder.Semantics.LangCompiler..ctor(CController pCtrl, NameManager pNameMgr)
   在 Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Reset()
   在 Microsoft.CSharp.RuntimeBinder.RuntimeBinder.GetInstance()
   在 Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags flags, ExpressionType operation, Type context, IEnumerable`1 argumentInfo)
   在 RT.Console.ZHCC.HIKReceiveUdp.OutoQueueAnaiysis(Queue sendQueue) 位置 d:\项目\VideoAnalysis\UdpMsgReceive\HIKReceiveUdp.cs:行号 16
   在 RT.Console.MainForm.OutoQueue() 位置 d:\项目\VideoAnalysis\MainForm.cs:行号 113
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart()


异常代码:
 while (sendQueue.Count>0) {
                string str = sendQueue.Dequeue().ToString();
                dynamic data = Newtonsoft.Json.JsonConvert.DeserializeObject(str);
                if (data == null) return result;

在本机dynamic可以跑的,但是在服务器上就会出问题。当把dynamic 换成对应的转换类的时候则不会出现对应的问题

echo_lovely的主页 echo_lovely | 小虾三级 | 园豆:1437
提问于:2020-07-21 14:12
< >
分享
最佳答案
0

使用对应类即可,可能是服务器上vs版本过低的原因

echo_lovely | 小虾三级 |园豆:1437 | 2020-07-28 16:31
其他回答(1)
0

用 var可以不

收获园豆:5
银龙科技 | 园豆:203 (菜鸟二级) | 2020-07-21 16:52
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册