资源与QUOT;重复的项目不被&QUOT支撑;参数 [英] Duplicate items are not supported by the "Resources" parameter

查看:235
本文介绍了资源与QUOT;重复的项目不被&QUOT支撑;参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

obj\Debug\BookStore.MainForm.resources 指定比资源再次参数。重复的项目不是由资源参数。

The item obj\Debug\BookStore.MainForm.resources was specified more than once in the Resources parameter. Duplicate items are not supported by the Resources parameter.

我要如何解决这个问题?

How do I fix this?

推荐答案

当您复制并粘贴在解决方案资源管理窗格中的一个形式此错误发生。然后,你改变形式之一名称。 Visual Studio中把同一个名字为,然后,当你重命名表时,Visual Studio做一些重构为你,为这两种形式重新命名设计类(不仅是新的)。

This error happened when you copy and paste a form in the 'Solution Explorer' pane. Then you change name of one forms. Visual studio give the same name for both and then, when you rename form, Visual Studio do some refactoring for you and rename Designer class for both forms (not only for new).

您可以解决此问题两种方式:


  1. 关闭微软的Visual Studio,然后浏览到您的从外部程序的项目文件夹(例如总指挥官)。进入其中,这两种形式的定义就可以看到你的窗体的的.cs和了.Designer.cs文件的文件夹。打开的.cs和了.Designer.cs文件在文本编辑器表单。查找和替换用新的名字原始形式的名称的每个实例。如果你已经改名重命名一些资源,检查文件的原始形式也(如果他们仅仅是原始形态的名字,但没有什么新的表单名称)。然后保存所有文件,启动Microsoft Visual Studio和重建项目。

  1. Close Microsoft Visual Studio, then browse to your project folder from external program (ex. Total Commander). Into the folder where both forms are defined you can see your form's .cs and .Designer.cs file. Open the .cs and .Designer.cs files for your form in a text editor. Find and replace every instance of the original form name with new name. And if you rename already rename some resources, check file for original form also (if they are only original form name but not anything for new form name). Then save all files, start Microsoft Visual Studio and rebuild your project.

您可以尝试chcek并为新的.cs原始形式名称的每个次数重命名声明和了.Designer.cs文件,但尝试禁用重构。如果你已经改名为新的形式,对了.Designer.cs旧形式也许你看到这一点:

You can try chcek and rename declaration for each occurance of original form name in new .cs and .Designer.cs files but try disable refactoring. If you already renamed new form, in .Designer.cs for old form you maybe see this:

namespace YourProjectNamespace
{
  partial class NewFormName
  { .. }

您必须重命名为NewFormName OldFormName并在Visual Studio中为您提供一个重构菜单(改名为对象的最后一个字母之前小章矩形)不会做任何事情。

You must rename NewFormName to OldFormName and when Visual Studio offer you a refactoring menu (small reg rectangle before last letter of renamed object) do not make anything.

这篇关于资源与QUOT;重复的项目不被&QUOT支撑;参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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