A file or folder with the name already exists Visual Studio

前端 未结 10 1224
南笙
南笙 2020-12-18 17:40

I try to add a new file to my source controlled VS2012 solution and receive this message:

A file or folder with the name \'xxx\' already exists. Pleas

相关标签:
10条回答
  • 2020-12-18 18:02

    The project file was unloaded in visual studio 2017

    image

    The easiest way is to copy your project folder and paste different repository then open your project in visual studio then after run the project, it should work. for example (D:--------->E:[here i mentioned repository these things])

    0 讨论(0)
  • 2020-12-18 18:03

    Visual Studio 2017 v 15.9.12 ... I ran into this problem, but with no actual folder conflict. In my case, I had solution folder named NewOrder, and I was trying to create a child project with the same name, but encountered the above error. I tried closing and reopening the solution (didn't restart VS so not sure if that would have made a difference) but here's what worked for me.

    • renamed solution folder
    • created my project. At this point, I got a strange error about not being able to locate the .net standard 2.0... so then I did restart VS, which fixed that problem
    • renamed the folder back

    Now everything works fine. I restarted VS again just for good measure and all works fine now.

    0 讨论(0)
  • 2020-12-18 18:04

    Click on Show All Files Menu in Solution Explorer and See That file in Controller, Views and Model Folder and delete that from there also

    0 讨论(0)
  • 2020-12-18 18:08

    Simply, On Solution Explorer Right CLick on Project's name -> Unload Project. then right click on the same project and click 'Reload'.

    Problem is Fixed (y)

    0 讨论(0)
  • 2020-12-18 18:11

    You need to give attention if adding a file automatically add other files/folders..for example if I added a controller which automatically add folder with controller name in views..I couldn't add controller .cs file until I deleted folder with controller name from views.

    0 讨论(0)
  • 2020-12-18 18:19

    If you're using MVC, and trying to create a new Controller, you should also check the Views and Models. Even though there was no folder or file with the Controller name, I had to delete a View folder with the same name (that already existed for some reason) using Show All Files and rebuild the solution.

    0 讨论(0)
提交回复
热议问题