【问题标题】:Two output file names resolved to the same output path两个输出文件名解析为相同的输出路径
【发布时间】:2014-02-24 07:53:36
【问题描述】:

我在 VS2013 中有一个项目,我使用 Telerik 的报告。 在解决方案中,我有一份报告和几门课程。如果我复制第一个报告重命名它,Visual Studio 报告错误:

Two output file names resolved to the same output path: "obj\Debug\...

如果我删除复制的报告并尝试通过向导将新报告添加到项目中,VS 会报告同样的错误。

您是否有经验丰富的人和您不知道解决方案的人?

谢谢

【问题讨论】:

    标签: resources visual-studio-2013 telerik-reporting


    【解决方案1】:

    我在使用实体框架代码首次迁移时遇到此错误,并且我在 Migrations 文件夹中的两个迁移具有相同的名称。

    Two output file names resolved to the same output path: "obj\Debug\***.resources

    我删除了重复的 migration.cs 文件,错误消失了。再次以相同的名称运行 add-migration 将其恢复。

    【讨论】:

      【解决方案2】:

      我有三个用于 userControl 的文件,它们都共享一个公共部分类,这导致了我的问题;它们被命名为 ucPlate.cs、ucPlate.Map.cs 和 ucPlate.Graphics.cs。当我将 ucPlate.Graphics userControl 表面更改为 DoubleBuffered 时,出现编译错误,“错误 21 两个输出文件名解析为相同的输出路径:”obj\Debug\ASMS.Controls.ucPlate.resources”恢复为 DoubleBuffered = false 确实没有修复它,也没有删除我打开DoubleBuffered时创建的.resx文件(以前没有.resx文件)。

      根本原因是在子部分类文件中打开 DoubleBuffered 会自动将 InitializeComponent() 添加到该文件的代码底部。此方法指示重复的 ucPlate 名称,强制为 ucPlate.cs 文件创建已存在的 .resx。我原以为它是 ucPlate.Graphics.resx。

      private void InitializeComponent()
      {
          this.SuspendLayout();
          // 
          // ucPlate
          // 
          this.Name = "ucPlate";
          this.ResumeLayout(false);
      }
      

      【讨论】:

        【解决方案3】:

        转到解决方案资源管理器(如果您重命名表单,请尝试查看您的错误并删除错误中的 .resx 文件)

        【讨论】:

          猜你喜欢
          • 2015-07-31
          • 1970-01-01
          • 2013-09-16
          • 1970-01-01
          • 2019-01-26
          • 2021-11-25
          • 2022-09-29
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多