给你举个例子吧: //Test1.cs namespace Test { public class Test1 { ... } }生成Test1.dll //Test2.cs namespace Test { public class Test1 { ... } }生成Test2.dllusing Test;public class App { public static void Main() { Test1 t1=new Test1();//错误:CS1595 } }不同的是你引用了你的一个类与系统定义的类冲突
是不是版本不对?装1.1的试试
它下面有一个CompilerGlobalScopeAttribute 属性类
但你这个类的名字就刚好与这个属性类名一样,产生冲突,
就算我这样说冤枉了你,,那就可能是你在这个类中定义一其他同名的东西如enum,struct 反正就是名称冲突
我没有进行任操作就这个样子
页面显示
“/WebApplication4”应用程序中的服务器错误。
--------------------------------------------------------------------------------编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS1595: 已在多处定义“System.Runtime.CompilerServices.CompilerGlobalScopeAttribute”;使用“C:\winnt\microsoft.net\framework\v1.0.3705\mscorlib.dll”中的定义源错误: 行 25:
行 26:
行 27: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
行 28: public class Global_asax : WebApplication4.Global {
行 29:
源文件: C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\webapplication4\7d21c451\710ef5c7\rgesmly4.0.cs 行: 27
//Test1.cs
namespace Test
{
public class Test1
{
...
}
}生成Test1.dll
//Test2.cs
namespace Test
{
public class Test1
{
...
}
}生成Test2.dllusing Test;public class App
{
public static void Main()
{
Test1 t1=new Test1();//错误:CS1595
}
}不同的是你引用了你的一个类与系统定义的类冲突