Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create a Visual Studio Solution File (.sln) in the same directory as the web project?

I'm using VisualSVN client and server and one of the requirements for web projects to work as expected is to have the .sln in the same directory (root) as the other files.

I thought it was as simple as removing all the extra parent paths ../ and other relative paths and saving it. However when I try to open it just locks up Visual Studio.

Is there a standard way to create this type of solution file or a solution file tool to help make sure it is valid? Or am I just missing something very obvious?

/
/MyWebsite.org.sln
/Images
/App_Data
/default.aspx
/default.aspx.cs

So apparently the trick, at least the one I was seeking is that you must use ..\MyWebsite.org or whatever the folder that contains the website files.

[EDIT] What I learned and my final .sln file for this particular project:

Here is the final Solution file that allowed me to open the website and have the .sln in the root of the web folder.

Project("{E24C65DC-7377-472B-9ABA-BCSG3B73C61A}") = "MyWebsite.org", "\", "{F8F4E96F-40BF-4374-B8BA-968D0SGG4A9E}"
    ProjectSection(WebsiteProperties) = preProject
        TargetFramework = "3.5"
        Debug.AspNetCompiler.VirtualPath = "/MyWebsite.org"
        Debug.AspNetCompiler.PhysicalPath = "..\MyWebsite.org\"
        Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\MyWebsite.org\"
        Debug.AspNetCompiler.Updateable = "true"
        Debug.AspNetCompiler.ForceOverwrite = "true"
        Debug.AspNetCompiler.FixedNames = "false"
        Debug.AspNetCompiler.Debug = "True"
        Release.AspNetCompiler.VirtualPath = "/MyWebsite.org"
        Release.AspNetCompiler.PhysicalPath = "..\MyWebsite.org\"
        Release.AspNetCompiler.TargetPath = "PrecompiledWeb\MyWebsite.org\"
        Release.AspNetCompiler.Updateable = "true"
        Release.AspNetCompiler.ForceOverwrite = "true"
        Release.AspNetCompiler.FixedNames = "false"
        Release.AspNetCompiler.Debug = "False"
        VWDPort = "1603"
        VWDDynamicPort = "false"
        VWDVirtualPath = "/"
    EndProjectSection
EndProject
like image 842
Brian Boatright Avatar asked Oct 17 '08 20:10

Brian Boatright


People also ask

How do I create a solution file .sln from a website in Visual Studio 2010?

when you build the website it will ask you an option to save the . sln file then you can save it inside your website . If saveing opening does not appear when you build then you can find this file inside.. here u can find you website name and fild you .


2 Answers

Generally what I do is start with a Blank Solution, which is under "Other Project Types-->Visual Studio Solutions" in the New Project dialog. Then, add the website and whatever other projects you need to the solution.

like image 104
AJ. Avatar answered Oct 01 '22 09:10

AJ.


THe other option is when you create the project simply uncheck the default box for "create directory for solution"

like image 27
Mitchel Sellers Avatar answered Oct 01 '22 09:10

Mitchel Sellers