When I create a MVC project in Visual Studio, it will automatically generate a solution folder with the same name alone with .sln file, packages folder.
For example:
/MyProject/MyProject
and when I run the application in server:
http://XXXXX/MyProject/MyProject
I hate the address. I want to the address looks like:
http://XXXXX/MyProject
I tried to move the solution folder to upper level directory, however, the MVC project can still run but show errors and many warnings.
Is there any way I can create a MVC and I can specify the solution folder? or I can relocate the MVC solution folder nicely?
Thanks
You can relocate sln file.
Just close solution, move sln file to project folder, and then open sln file in VS.
Project will not load. Delete unloaded project in Solution Explorer, then right click on solution (in Solution Explorer) Add => existing project...
and select .csproj file of the project.
Rebuild application, nuget will restore packeges.
But I don't know why You hate path.
You can name solution folder with diffrent name then Your project. when You add more projects every project folder will be in one solution folder and path will looks like:
http://XXXXX/Solution/Project1
http://XXXXX/Solution/Project2
And one last thing: You probobly don't want whole solution in application server, you can just deploy project as web deploy packege.
Related
Here is my Solution files structure (folders are prefixed by +):
+FooProject
FooProject.sln
+Tests
+BarTests
BarTests.csproj
Now I want to move the BarTests project to a new subfolder UnitTests:
+FooProject
FooProject.sln
+Tests
+UnitTests
+BarTests
BarTests.csproj
I tried the following ways but to no avail:
If I add a New Solution Folder, UnitTests, in Visual Studio, and move the BarTests to UnitTests folder in Visual Studio, then no new folder is created on disk, and no changes to the solution file are made, hence can't propagate this change in the source control.
I create the UnitTests folder directly on disk (using File Explorer or Command Line), move the BarTests to UnitTests, and then manually update the solution file to reflect this change in the path. Now the problem is in Visual Studio, I still see the BarTests project under the 'Tests' folder and not the UnitTests folder.
I tried the second approach even after closing VS and deleting the .vs folder but still the same behavior.
What am I missing here?
Solution folders within Visual Studio are just used to organise solution-level assets such as projects and other solution folders within Visual Studio itself and are not permeated to disk.
When you move a folder on disk and change the reference to it within the .sln file, you are doing exactly that.
Really simple solution, do exactly what you have tried already and you can even do it within Visual Studio by switching to "Folder View" within the Solution Explorer.
Unload or remove the BarTests project from the solution within Visual Studio.
Create your physical "UnitTests" target folder on disk in the desired location and move the BarTests project folder and files to the target location.
Return to Visual Studio and repeat, create your solution folder for UnitTests and then add your project to that solution folder (if you removed then you select "Add existing project" from the menu).
I created a folder called BatchFiles in TFS for an SSIS project, but the folder will not show in the solution explorer. I've also noticed that .dtproj file will not show, even if I click the "Show All Files" button on top. Is there any way to show the new folder I created in solution explorer? Also will the .dtproj file always be hidden?
Add new item directly to the project does this:
Adding an existing item option automatically dumped it in Miscellaneous Folder, that looks like this:
Seems like those existing items are not being considered as project files but as misc files when being opened from solution explorer.
This seems to be an expected behavior
Any files in the dialogue box which does not have extension such as
dtsx or config .Selecting these files will automatically place them in
Miscellaneous folder
How to Add a File to the SSIS Project Miscellaneous Folder
If the file exists on disk (physically in the folder) but does not show in the solution then it is likely that the file was checked in, but the modification to the solution was not. And for BatchFiles folder, you just add them in the source control explorer. That's why there are not the in the solution explorer.
Also will the .dtproj file always be hidden?
Seems to be so. I have also reproduced and got the same behavior like this. Sorry, not very familiar with SSIS project. But according to some tutorials in google such as this
Blog : Building your SSIS project in Azure DevOps It not appears, but we also able to build it through Azure DevOps.
I have a solution with a web site project and two library projects (.dll).
The web site has references to the two dlls. The references are added as project references.
The web site also has a binary reference to log4net.dll.
When we build the solution the pdb files from the two project references is automatically added to TFS source control under the web site Bin folder.
How can I prevent this from happening?
Peter B. Frederiksen
By defaut a Web Site project has no option to include or exclude files. As such they do not work well with source control systems and are not recommended for use.
You need to flip over to a Web Application. This is simple but has ramification.
Create an empty web application
Update the settings and assemblyinfo to be what you want
Copy only the Project file and the AssemblyInfo files into the Web Site location (maintain folders.)
Add the new project to your solution with "open existing"
Make work / build
Remove web site from solution
Remember that your files are now pre-built and you may need to fix duplicate class names that are allowed in web sites.
It looks like from the diagram above that your bin directory was somehow checked in as part of source control, this directory should be deleted (bin) from tfs unless you intend to version the output, which in this case you should not.
I was unable to find App_Start folder in my MVC4 application. I was already tried "show all files" option in solution explorer. Even though I didn't got the folder. so, anyone give me a solution to find the folder.
This folder is automatically added by the Wizard when you create a new ASP.NET MVC 4 application in Visual Studio. If you cannot find it that's probably because somebody deleted it. You could always add it manually if necessary.
I think I've seen this done once, but I cannot find it again after a long Googling/Binging session!
I'd like to create a new ASP.NET MVC project, then create a folder "Web" inside the project, and move all the "web-related" files to inside this folder.
The problem is that when creating this folder structure, I cannot simply press "F5" to start the Webdev.Webserver, because the "physical path" of my application is still pointing to my project root folder.
In the project settings, I've found the configurations for the development server, where I can change the port, for example, but there's no option to specify the "physical path".
Is there a way to do this?
Thanks!
If you are trying to separate Web-related files from, say, Domain-related files, the best you have to do is to created separate projects inside the same solution.
Let's say you create a Store solution. You could then create different projects called Store.Web, Store.Domain, Store.Test, etc.