DEV Community

Discussion on: Visual Studio, Why Can't You Just Let Me Have This One (Solution Folder)?

Collapse
 
cookrdan profile image
Dan

I suspect this isn’t actually VSCode’s fault. If I remember correctly a folder is basically a file just a certain type. You can try in terminal and you still have the same problem:

# make a file:
touch some_name

# make a folder with same name:
mkdir some_name

# error:
mkdir: can't create directory 'some_name': File exists  
Collapse
 
rionmonster profile image
Rion Williams

Hi Dan,

Thanks for the reply, I’m sure the mkdir tip will be helpful to someone that hasn’t encountered it before.

It’s worth noting that this is regarding Visual Studio proper as opposed to Visual Studio Code, which in this scenario will make a bit of a difference. Visual Studio has a concept of Solution folders, which are logical and this don’t necessarily map to physical ones on disk.

The issue here was that I already had a project (and project folder) of a specific name, Foo.Logging. As time passed a few other logging specific implementations such as Foo.Logging.Serilog, Foo.Logging.log4net, etc. came along, which for organization purposes I wanted to house in a single, logical solution folder called “Foo.Logging”, and thus the issue arose can which is almost assuredly a Visual Studio tooling issue as opposed one a simple naming conflict.

I hope that makes sense - and thanks again for the read/reply.

Collapse
 
cookrdan profile image
Dan

AH! I misunderstood that it wasn’t vscode. Haha!
I was curious about your screenshot - so similar but a little different.
Yeah I agree it looks like an issue with the tool then. Is there some place to report it/request a fix? I’ve never used Visual studio

Collapse
 
cookrdan profile image
Dan • Edited

More on the above and maybe a little solution (in bash):

# make a file
[~]$  touch some_folder                                    

# make a folder with the same name (won't work)                                           
[~]$  mkdir some_folder                                    
mkdir: can't create directory 'some_folder': File exists   

# okay so instead make a _tmp folder, move the file(s) in there, then rename the _tmp folder to intended name                                                          
[~]$  mkdir _tmp; mv some* $_; mv $_ some_folder           

# here's the folder                                                           
[~]$  ls                                                   
some_folder                                                

# here's the contents of it                                                           
[~]$  ls some_folder/                                      
some_folder

$_ in bash is the last parameter given to the previous command.