Two output file names resolved to the same output path

笑着哭i 提交于 2019-12-13 16:58:52

问题


I have a project in VS2013, where I use the report from Telerik. In the solution I have one report and a few classes. If I copy the first report rename it, Visual Studio reports error:

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

If I Remove the copied report and try to through the wizard add a new report to project, VS report me the same error.

Do you have someone with experience and someone you do not know the solution?

Thank you


回答1:


I got this error when using entity frameworks code first migrations and had the same name for two of my migrations in the Migrations folder.

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

I deleted the duplicate migration.cs file and the error went away. running add-migration again with the same name brought it back.




回答2:


I had three files for a userControl, all sharing a common partial class, and this caused my issue; they were named ucPlate.cs, ucPlate.Map.cs, and ucPlate.Graphics.cs. When I changed ucPlate.Graphics userControl surface to DoubleBuffered, I got the compilation error, "Error 21 Two output file names resolved to the same output path: "obj\Debug\ASMS.Controls.ucPlate.resources" Reverting to DoubleBuffered = false did not fix it, nor did deleting the .resx file that was created when I turned on DoubleBuffered (previously, there was no .resx file).

The root cause was that turning on DoubleBuffered in the subsidiary partial class file auto-added InitializeComponent() to the bottom of my code for that file. This method indicated the duplicate ucPlate name, forcing a .resx creation that already existed for the ucPlate.cs file. I had expected it to be ucPlate.Graphics.resx.

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



回答3:


go to the solution explorer (if you rename a form e try to look at your error and delete the .resx file that have in your error)



来源:https://stackoverflow.com/questions/21981896/two-output-file-names-resolved-to-the-same-output-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!