存在任何关闭此为重复之前 - 请注意,它不是一个LINQ或其他数据源的问题,我已经看了其它计算器职位,没有一个是相同。类型或命名空间名称DataAnnotations'不存在命名空间“System.ComponentModel”
这里是我的问题:
的Default.aspx代码:
它非常简单的应用程序ASP.net背后没有任何花哨的东西朴素简单的C#代码,你可以从下面的代码见
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%=returVar%>
Default.apsx.cs
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
public string returVar;
protected void Page_Load(object sender, EventArgs e)
{
string n = String.Format("{0}", Request.Form["test"]);
//below we will place the code for ODP.net once the DB connectivity is resolved
if (n.Length == 16)
{
returVar = "Found";
}
else
{
returVar = "Not found";
}
}//Page_Load
}
最后的web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false"/>
</system.web>
</configuration>
我的dev的机器是:赢得32 XP Visual Studio 2010和服务器运行的是64位赢得2008 R2和IIS7.5。
那么,为什么这个错误发生的历史,当我在我的桌面上运行此代码它就像一个魅力与HTTP通过火狐如下:
http://localhost:3117/Default.aspx?test=0998989765432345
完全相同的代码将失败,并附加截屏,能有人告诉我为什么请提出解决方案。我尝试在解决方案资源管理器中包含所有我的DLL,即解决方案资源管理器>参考> system.core,system.data等...>所有设置为copy local = true。
仍然没有运气。
请注意,我不能在服务器和我有部署什么都必须是应用程序的一部分上安装任何额外的组件。
检查这个环节,这可能是有益的 [点击此链接] [1] [1]:HTTP://计算器。com/questions/10174420/why-cant -i-reference-system-componentmodel-dataannotations/22644777#22644777 – 2014-03-25 19:49:47