2010-11-11 57 views
0

我正在尝试使用简单的LINQ to Objects查询。linq to object - 未找到方法

当我尝试运行我的应用程序得到的消息:

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 

回答

0

根据所给出的例外,它看起来像它甚至从来没有进入您的查询 - 这是在建立Form1是哪里错了,可能是在建设电影的表。

2

看那的InnerException

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

+1。你有'Option Strict On'吗?如果没有,请将其打开:然后我怀疑编译器可能会为您确定问题。 – MarkJ 2010-11-11 13:06:14