亚新()的具有相同签名的多个定义 [英] Sub New() has multiple definitions with identical signatures

查看:355
本文介绍了亚新()的具有相同签名的多个定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.Net Web窗体应用程序(不是网站的Web应用程序)的工作在Win 7和一切都很好。

I was working in ASP.Net web forms application (website not web application) on Win 7 and everything was fine.

我不得不把我的解决方案,另一台机器也赢得7,有一次我这样做,一切都变得不正常。

I had to transfer my solution to another machine also win 7, once I did that everything became NOT OK.

当我建立我的解决方案我吨的建筑误差的现有文件

when I build my solution I got tons of building errors in files existing in

C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\临时ASP.NET文件

大多数这些错误的,例如

most of these errors such

保护小组的新建(信息作为System.Runtime.Serialization.SerializationInfo,上下文System.Runtime.Serialization.StreamingContext)的具有相同签名的多个定义。

的Public Sub New()'有具有相同签名的多个定义。

我GOOGLE了它,并试图在所有网站中列出的所有解决方案。清理我的解决方案,并重建它,
结算 ASP.NET临时文件文件夹,清空 C:\\用户\\用户\\应用程序数据\\本地的\\ Temp ,并手动删除 .NETFramework,版本= v4.0.AssemblyAttributes.cs 中存在的Temp文件夹

I googled it and tried all solution stated in all sites. clearing my solution and rebuild it, clearing Temporary ASP.NET Files folder, clearing C:\Users\user\AppData\Local\Temp and also manually deleted .NETFramework,Version=v4.0.AssemblyAttributes.cs exists in Temp folder

即使我创造了新的解决方案,以不同的名字,但当然我是从旧的解决方案导入的文件。

even I created new solution with different name but of course I imported files from old solution.

对于我来说没有什么工作,我不知道究竟是什么问题,为什么会发生,我怎么能解决这个问题,并回我的解决方案的生活吗?

Nothing work for me, I don't know what is the problem exactly and why it happen and how can I solve it and back my solution to live?

推荐答案

通常,当您使用Visual Studio为您生成一些code(用于数据或其他)它确实他们为部分类... 这样你就可以创建另一个部分类并添加自己的code同一类,而不当工具重新生成它的code失去更改。很长的故事。

Usually when you use Visual Studio to generate some code for you (for data or whatever) it does them as Partial Class ... so you can create another partial class and add your own code to the same class without loosing your changes when the tool regenerates it's code. Long story.

不管怎样,因为这是一个网站,该文件夹中的所有文件是项目的一部分。如果你不小心复制同一个文件,它会自动添加和你用同样的方法和属性(如新)部分类现在有多个定义。

Anyway, since this is a web site, all files in the folder are part of the project. If you accidently copy the same file twice, it is automatically added and your partial class with the same methods and properties (like NEW) now have multiple definitions.

查找相同的类的副本。

这篇关于亚新()的具有相同签名的多个定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆