In VS2015 on Mac with an ASP.NET CORE project, when I try to create a new folder by right clicking the project in the solution explorer > Add > Folder. But it says it already exist:
File or directory name is already in use. Please choose a different
one.
I go into finder and see the folder is there. Why doesn't it display in VS2015?
Related
Visual Studio seems to consist of a single solution file (*.sln) along with one or more project files (a C# project would have the *.csproj extension).
I have been playing around with a console application that parses existing directory entries to create solution files with the associated project files.
It works, but every time I run into a new project here at work I find myself spending a week or more debugging my console project so that it can churn out a solution for that particular work project.
Is there something out there already that can create a VS solution out of an existing file structure?
As you can tell from my screen capture below, these projects are nested very deep, so it would take a very long time to do this with the apps folder below with the "by mouse" technique in the Visual Studio IDE.
I created the custom console application that is posted in this post:
https://stackoverflow.com/a/22153536/153923
I invite others to contribute how they approached this solution, though.
So, I found out today that this feature already exists in Visual Studio.
Link 1: How to: Create a Project from Existing Code Files
Link 2: How to: Create a Project from Existing Code Files
Basically, though, it says this (just in case the MSDN links get changed or deleted):
You can create a Visual Studio project from an existing app—for example, an app that you obtained from an online source. Project and solution files are created on your computer and the other relevant files are added. A project can be created from Visual C++, Visual Basic, or Visual C# code files.
Security note Security Note
We recommend that you determine the trustworthiness of existing code files before you import them into Visual Studio, because Visual Studio will execute some of the code in a fully trusted process when you open the newly created project.
To create a project from existing code files
On the menu bar, choose File, New, Project From Existing Code.
The Create New Project from Existing Code Files wizard opens.
Use the wizard to specify the details of the existing code files that will be added to the project and the application that will be created when you build the project.
Another good answer was given by cbp in Visual Studio: Create a web application from existing code:
--
OK I figured it out. It's weird, but the following steps will work:
Open fresh copy of Visual Studio
File->New Project, select Web Application
Use the following settings:
Name: Website (this is the name of the existing folder with the website files in it)
Location: C:\Temp\ (anywhere will do for now)
Solution Name: TheProject (name of the existing project's root folder)
Check "Create directory for solution"
Delete the auto-created Default, Global and Web.config files
Save All and close Visual Studio
In Windows Explorer, copy the new folder on top of the existing folder so that the files are merged.
Double click on the sln file to open Visual Studio again.
Select "Show all files" (at the top of Solution Explorer)
Right click on any files or folders you want to add and select Include in Project.
Great idea!
I'm trying to open existing files that were previously opened as a project in Visual Studio, but I moved them and renamed the folder. How can I open these files in Visual Studio as a project?
I'm not sure what you mean by website project. If its the solution files you want then way I found worked for me.
However, If its the project files that add DLL's to your site you will need to create a new project of the same type and copy your code in that project. But the Project file that opens these should still work if it was copied over with the other files.
To add an existing folder to a Solution: Open the the folder as a new website. Ensure that any old .sln files are deleted from the new folder.
When you attempt to close Visual Studios it should prompt you to save your site in a new solution(.sln) file
I have a Visual Studio 2013 project within a folder called 'Source', let's say. I'd like to have some additional folders within that folder and I'm trying to find a way to do that. If I, in visual studio, create a new 'filter' (which looks like a folder) and create a file within it. It might appear to be within a new folder (as displayed by Visual Studio), but it actually is in the default Source folder.
I try a second approach and create the folder with the help of the operating system. I even create a file within it manually. Then I go to visual studio and add an existing item, selecting the file WITHIN the folder. Visual studio then adds the file, which is good, but its displayed as being in the default directory.
I suppose there is a very manual way. And thats mirroring everything. Creating a folder using the operating system. Creating a filter within visual studio, etc. And mirroring everything manually.
Is there a different way or do I create a better IDE in 2 days?
Simple Drag and Drop should work.
Keep your directory with source inside your project directory.
Drag and Drop directory structure from windows explorer to visual studio existing project.
Click "Show All Files" option in the top of Solution Explorer toolbox
After doing this you need to add this directories in your project.
Select that directory, right click and select "Include in project"
You are good to go!
Details here
I am creating a project based off an old project because it has a lot of the functionality that I am required to use.
I want to rename all the directories and solution names to have the name of the new project. Under Documents\Visual Studio 2008\Projects I was able to change the initial directory and solution file names, but not the name of the subdirectory which houses the bin, obj, and properties folders. When I change the name of that subdirectory, none of the files will open when I open up the solution.
How can I change the project's folder name inside Visual Studio 2008 so that it will load all the files as part of the solution and still work?
You could open the SLN file in any text editor (Notepad, etc.) and simply change the project path there.
This is what I did:
Change project and solution name in Visual Studio
Close the project and open the folder containing the project (The Visual studio solution name is already changed).
Change the old project folder names to the new project name
Open the .sln file and the change the project folder names manually from old to new folder names.
Save the .sln file in the text editor
Open the project again with Visual Studio and the solution is ready to modify
I found that these instructions were not enough. I also had to search through the code files for models, controllers, and views as well as the AppStart files to change the namespace.
Since I was copying my project not just renaming it, I also had to go into the applicationhost.config for IIS express and recreate the bindings using different port numbers and change the physical directory as well.
go to my start-documents-iisExpress-config and then right click on applicationhost and select open with visual studio 2013 for web
you will get into applicationhost.config window in the visual studio
and now in the region chsnge the physical path to the path where your project is placed
I have a web application project made in Visual Studio 2008.
Well, I added a jquery folder and added it to source control and other such things. I forgot to add it to the visual studio project though. How do I add the existing folder now? I've tried just creating a new folder and naming it jquery but it gave me a cryptic error "the directory is already on the disk ... if you want to see this directory then check the Show All Files option in the project file" Yet I looked and saw no such option.
Is the only way around this to rename jquery to jquery2 and then create a new folder via visual studio named jquery and copy all my files into it?
With your project open in Visual Studio, click on your project. Then go to the "Project" menu and select "Show All Files". You should now see any directories or file that are in the directory of the project but not included in the project.
Then, right-click on the folder you want to add, and select "Include in Project" from the context menu.