简体   繁体   English

运行 ASP.NET 应用程序时出现 CS0102 错误

[英]CS0102 error while running ASP.NET application

I get this error in the App_directory C# code file,我在 App_directory C# 代码文件中收到此错误,

CS0102: The type ClassName already contains a definition for 'mappingSource'

It points to line,它指向线,

private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

What is the likely mistake?可能的错误是什么? Using vs 2008 and .net 3.5使用 vs 2008 和 .net 3.5

It means the class 'ClassName' already has a 'member' (aka variable) named 'mappingSource' defined.这意味着 class 'ClassName' 已经定义了一个名为 'mappingSource' 的 'member' (又名变量)。 So just choose another name for it and it should compile.所以只需为它选择另一个名称,它应该可以编译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM