I am creating a asp.net website and when I open it, Visual Studio asks me to create solution file every time. But I don't want the solution files at all. How can I create a website without a solution file? There are other related questions in stack overflow but they give workaround by creating the solution file. I don't want to create solution file.
Asked
Active
Viewed 191 times
1
-
1Why do you want to not do a solution file? – mason Apr 17 '14 at 01:30
-
I don't want an additional file in my project. I open the website from IIS in Visual Studio and solution (sln) file is no use to me. Do you think having sln will give me additional benefit? I don't want to add any additional projects in the site. It's just a simple website with couple of pages. – Apr 17 '14 at 01:32
-
The solution file isn't _hurting_ anything. You can ignore it if you want. – mason Apr 17 '14 at 01:35
-
According to this page the solution is required: http://msdn.microsoft.com/en-us/library/zfzh36t7.aspx – Ben Aaronson Apr 17 '14 at 01:36
-
Perhaps your needs would be better served by right clicking on the solution file, clicking Properties, checking the Hidden attribute, and closing the Properties window. – mason Apr 17 '14 at 01:40
-
That's kind of Ostrich Algorithm you're suggesting :) But the solution file will still be there. So, does this mean it's compulsory to have a solution file for any type of project while using visual studio? – Apr 17 '14 at 01:42
-
@mason "Although a project must reside in a solution, you can create a solution that has no projects." – Ben Aaronson Apr 17 '14 at 01:47
-
@BenAaronson Is a web site considered a project, even without a `.csproj` file? I guess so, at least for these purposes. – mason Apr 17 '14 at 01:48
-
@mason Do web sites not have `.csproj` files? I may be thinking of a different project type then – Ben Aaronson Apr 17 '14 at 01:50
-
@BenAaronson `Web Sites` do not have `.csproj` files, but `Web Applications` do. – mason Apr 17 '14 at 01:52
-
@mason Ah, I stand corrected. – Ben Aaronson Apr 17 '14 at 01:56
-
I'm still here guys ! :) – Apr 17 '14 at 02:05
-
So does it mean there is no alternative to creating solution for website? – Apr 17 '14 at 02:36
1 Answers
1
If you do a New Website
instead of New Project -> New Web Application
, you can easily move the site's code files around. You don't need a solution file (although one will be generated in a separate location). You can ignore that solution file for the most part. I think that's as close as you can get to a "no solution" ASP.NET website.
Note that the New Website approach doesn't generate a project file (.csproj), which you may also want to get rid of if I'm following your line of reasoning correctly.
See ASP.NET Web Site or ASP.NET Web Application? for a discussion of Web Site vs Web Application.
-
In conclusion, it seems solution file is necessary even if we create a website only as .NET uses it to manage the site as well as the projects that may be added later. Hence, it's not possible to have a website with just a list of files. There has to be a solution file or VS will attempt to create it if not present. – May 05 '14 at 00:32