linq to object - 找不到方法

时间:2010-11-11 08:00:15

标签: asp.net vb.net linq exception

我正在尝试使用简单的LINQ to Objects查询。

当我尝试运行我的应用程序时,我收到消息:

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Method not found: 'Void sharatTashlumimWS.paymentDetailsManager.set_ReleaseDate(System.DateTime)'."
  Source="WindowsApplication1"
  StackTrace:
       at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
       at WindowsApplication1.My.MyProject.MyForms.get_Form1()
       at WindowsApplication1.My.MyApplication.OnCreateMainForm() in C:\MmiSources\Ksafim\APPLICATIONS\TashlumZikuy\Tashlumim\sharatTashlumimWS\WindowsApplication1\My Project\Application.Designer.vb:line 35
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.MissingMethodException
       Message="Method not found: 'Void sharatTashlumimWS.paymentDetailsManager.set_ReleaseDate(System.DateTime)'."
       Source="WindowsApplication1"
       StackTrace:
            at WindowsApplication1.Form1..ctor()
       InnerException: 

如果我将此代码放在ASP应用程序中,它运行良好。

我的linq声明是:

Dim query = From m In movies Select m

2 个答案:

答案 0 :(得分:2)

查看InnerException

InnerException: System.MissingMethodException
       Message="Method not found: 'Void sharatTashlumimWS.paymentDetailsManager.set_ReleaseDate(System.DateTime)'."
       Source="WindowsApplication1"
       StackTrace:
            at WindowsApplication1.Form1..ctor()
       InnerException:

答案 1 :(得分:0)

根据给出的例外情况,它看起来似乎永远不会出现在您的查询中 - 设置Form1时出现问题,可能是在制作电影表时。