none
Duplicate files appearing in solution explorer of Visual Studio 2015

    Question

  • Hi,

    I'm observing this weird behavior  in Visual Studio 2015.

    Duplicate files are present in the solution explorer.

    Though, only a copy of these duplicate files exist physically on the disk.

    Is there any way to resolve this.

    Kindly, let me know.

    Thanks in advance :)

    Friday, January 15, 2016 6:49 AM

Answers

  • Hi Harshul Antriwale,

    If the duplication only for specified project. I think the cause is probably in your  project.

    Right click your project and unload your project, then reload your project again.

    Also you could try to create a new empty solution and copy the files from this project to the empty solution then build it again.

    If still no help, may be you need to create a new MVC project and copy code form this specified project to the new MVC project.

    Best Regards,

    Lake Xiao

    Thursday, January 28, 2016 7:13 AM
    Moderator

All replies

  • Trying to add extra copies of the same file did nothing for form and module .vb files.

    Could you be more precise about which files are duplicated?

    And have you checked the complete path of the file in solution explorer of the IDE?


    Cyrille Precetti
    Bonne Année! Happy New Year!

    Friday, January 15, 2016 11:37 AM
  • Hi Cyrille ,

    Thanks for your reply.

    I'm working on asp.net mvc project.

    Even on checking-in or taking latest, files duplicate. 

    But physically there is only one file present.

    Thursday, January 28, 2016 6:22 AM
  • There is one Property "Copy To Output Directory" which is set to Do Not Copy.

    I'm guessing if this has something to do with duplication.

    Thursday, January 28, 2016 6:33 AM
  • Hi Harshul Antriwale.

    "Copy To Output Directory"  is used to copy the file to the executing directory like "Debug" folder when compiling.

    So I think it will not the cause of your issue.

    For your issue, First I suggest you could clean your solution and rebuild it again.

    Or close your Visual Studio and reopen it then open the this MVC project and check the behavior.

    If still no help, I suggest you could create a new MVC project and check whether has the duplicated files.

    If still has the same problem. I suppose there is something wrong with your Visual Studio.

    In this case, please repair your Visual Studio or install VS2015 Update then try it again.

    Hope that could be helpful to you.

    Best Regards,

    Lake Xiao

    Thursday, January 28, 2016 6:45 AM
    Moderator
  • Hi Lake,

    I tried your solution.

    Newly created solution does not have duplication, but this existing one has.

    I guess something is wrong with the my project :(

    Thursday, January 28, 2016 6:52 AM
  • Hi Harshul Antriwale,

    If the duplication only for specified project. I think the cause is probably in your  project.

    Right click your project and unload your project, then reload your project again.

    Also you could try to create a new empty solution and copy the files from this project to the empty solution then build it again.

    If still no help, may be you need to create a new MVC project and copy code form this specified project to the new MVC project.

    Best Regards,

    Lake Xiao

    Thursday, January 28, 2016 7:13 AM
    Moderator