Asp.net mvc 我不确定Xval和远程验证有什么问题

Asp.net mvc 我不确定Xval和远程验证有什么问题,asp.net-mvc,xval,Asp.net Mvc,Xval,我经历了这一切,看起来真的很好。所以我浏览了一遍,下载了示例文件 我一直在玩它,我知道如何使用它,并能够添加我自己的验证了它 所以我决定把它添加到我目前正在进行的项目中。当我尝试我的表单时,我已经能够让它编译并运行了。没有验证客户端和服务器端都发生了 我不知道为什么。所以我做了另一个项目,并试图再次添加所有的东西,但我不知道我错过了什么它不起作用 这是我向您展示他们太多文件的唯一真实方式,无法复制和粘贴代码 我甚至还没有在测试中使用远程验证部分。我只使用xval的类似直接的东西,就像我有一样东西

我经历了这一切,看起来真的很好。所以我浏览了一遍,下载了示例文件

我一直在玩它,我知道如何使用它,并能够添加我自己的验证了它

所以我决定把它添加到我目前正在进行的项目中。当我尝试我的表单时,我已经能够让它编译并运行了。没有验证客户端和服务器端都发生了

我不知道为什么。所以我做了另一个项目,并试图再次添加所有的东西,但我不知道我错过了什么它不起作用

这是我向您展示他们太多文件的唯一真实方式,无法复制和粘贴代码

我甚至还没有在测试中使用远程验证部分。我只使用xval的类似直接的东西,就像我有一样东西是必需的电子邮件

编辑现在我得到一个错误

System.IO.FileNotFoundException was unhandled by user code
  Message="Could not load file or assembly 'System.ComponentModel.DataAnnotations, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."
  Source="Online.com"
  FileName="System.ComponentModel.DataAnnotations, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
  FusionLog="=== Pre-bind state information ===\r\nLOG: User = CHOBO2\\chobo\r\nLOG: DisplayName = System.ComponentModel.DataAnnotations, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\n (Fully-specified)\r\nLOG: Appbase = file:///I:/OnlineV2/trunk/Current Site/\r\nLOG: Initial PrivatePath = I:\\OnlineV2\\trunk\\Current Site\\bin\r\nCalling assembly : Online.com, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: I:\\OnlineV2\\trunk\\Current Site\\web.config\r\nLOG: Using machine configuration file from C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\config\\machine.config.\r\nLOG: Post-policy reference: System.ComponentModel.DataAnnotations, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\r\nLOG: The same bind was seen before, and was failed with hr = 0x80070002.\r\n"
  StackTrace:
       at Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder.GetTypeDescriptor(Object model, Type modelType)
       at Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder.GetModelProperties(ControllerContext controllerContext, ModelBindingContext bindingContext) in I:\OnlineV2\trunk\Current Site\Models\DataAnnotationsModelBinder\DataAnnotationsModelBinder.cs:line 35
       at System.Web.Mvc.DefaultModelBinder.BindProperties(ControllerContext controllerContext, ModelBindingContext bindingContext)
       at System.Web.Mvc.DefaultModelBinder.BindComplexElementalModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Object model)
       at System.Web.Mvc.DefaultModelBinder.BindComplexModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
       at System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
       at System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor)
       at System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
       at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
  InnerException: 

你仔细看过错误了吗?似乎找不到文件。我很惊讶它甚至可以编译,但我对文件引用知之甚少。此错误出现在您的测试盒上,而不是在您将其发布到另一台计算机之后

我先从你的参考资料中删除它,然后重新添加它


显然,DataAnnotations需要.NET 3.5SP1,但如果您只是稍微更新了一点,就应该使用它。

我也有类似的问题。我在项目中下载、构建和引用了新程序集。工作起来很有魅力。

是的,我读到了错误。我知道电话在哪里。未移动任何内容,因此路径100%正确。虽然我把它放在我的bin目录中的一个自定义文件夹中,但我还是找到了它。xVal似乎想直接在bin根目录下使用它,而不是在其他地方。