VS2005为什么会有两个AssemblyInfo

来源:互联网 发布:手机java模拟器 编辑:程序博客网 时间:2024/04/29 11:58
为了迁移VS2003的Web Application到VS2005的Web Application,我在VS2005新创建一个Web Application,删除其中的页面,然后将我在VS2003下面的页面以及代码移动到新的应用程序目录下面,并将它们都添加到工程里面。结果编译的时候发现出现这个编译错误。
The item "Properties/AssemblyInfo.cs" was specified more than once in the "Sources" parameter.  Duplicate items are not supported by the "Sources" parameter.
根据错误提示,用文本编辑器打开.csproj文件,找<Compile Include="Properties/AssemblyInfo.cs" />节,会发现有两个,删除其中一个就没有问题了。
估计这是微软的一个bug,我无意中将另一个应用程序中的Assembly添加到当前的应用程序里,VS2005会自动在.csproj文件中自动添加该节,但是删除该文件的时候VS2005并不会自动删除这个节,导致了这个编译错误。
原创粉丝点击