Unanswered How to work with web _sites_ in TFS.

  • Thursday, April 19, 2012 3:10 PM
     
     

    I have a Web Site (not a Web App) stored in TFS.  When I open the website with File -> Open -> Web Site and then navigate to C:\TFS\MyWebsite and hit ok, it opens the project in the Solution Explorer.  The top line item in the window is "Solution 'MyWebsite' (1 project)".  The folder C:\TFS\MyWebsite is the only item under it in the tree structure.  Essentially it seems to want to create a solution file to manage the Web Site.

    If I click on that solution file, the properties windows shows me it anticipates saving that solution file to My Documents\Visual Studio 2008\projects\MyWebsite.  If I save that solution file, obviously it is not in source control it is in My Documents.  If someone else on my team does the exact same thing, they'll have a different solution file in their My Documents file.  These could obviously get out of sync.

    Should I be checking in a .sln file into source control and having everyone open the Web Site via that solution file in the future?  What is the best practice here?  Am I opening the Web Site wrong in the first place?  I'm struggling to understand what role that .sln plays here since I was under the impression a Web Site was essentially just a directory and wouldn't even have a solution file - but Visual Studio seems to create it for me without asking me if I want to do that.  Can anyone help clarify what's going on here?

    Thanks.

All Replies

  • Thursday, April 19, 2012 3:35 PM
     
     

    Wonger,

    As you specified you need have both the Website project and Solution file checked in to TFS. That way your entire team members would have the same solution file to work on, also in future if you add another project (Code Library) to this solution, you will be updating the same solution file.

    The Best practice is having the solution file and project files in TFS/Source Control.


    Regards,
    Adhi
    My TFS Blog
    Please remember to mark as answered, if this reply helps

  • Thursday, April 19, 2012 3:54 PM
     
     
    My local c:\TFS\MyWebsite corresponds to $\MyWebsite in TFS.  So if I put the solution file in \MyWebsite then it actually shows up as one of the files included in the WebSite in the Solution Explorer which is confusing and strange.  Should we be creating solution-level folders above the Web Site folder and putting the .sln in there?
  • Thursday, April 19, 2012 4:23 PM
     
     

    Ok. Here is the structure we use, you might need to change the folder structure a bit

    $/<TeamProjectname>/Development/<ApplicationName>/

    The Solution files and project folders would be under that folder

    Example:

    $/<TeamProjectname>/Development/<ApplicationName>/website.sln

    $/<TeamProjectname>/Development/<ApplicationName>/project/project.csproj

    $/<TeamProjectname>/Development/<ApplicationName>/project/sample.cs

    Here is more detail about solution file structure

    http://msdn.microsoft.com/en-us/library/bb668992.aspx


    Regards,
    Adhi
    My TFS Blog
    Please remember to mark as answered, if this reply helps

  • Thursday, April 19, 2012 4:54 PM
     
     
    Correct me if I'm wrong, there is no .csproj for Web Sites (as opposed to Web Apps)?
  • Thursday, April 19, 2012 6:15 PM
     
     

    You are right. I just provided the sample structure. Instead of project.csproj file, it would be App_Code or App_Data folders and other files under the <Project> folder for web sites.

    Hope that make sense.


    Regards,
    Adhi
    My TFS Blog
    Please remember to mark as answered, if this reply helps

  • Friday, April 20, 2012 2:58 AM
    Moderator
     
     

    Hi Wonger,

    How about the issue now?

    Adhithan has provided detail information of this issue, you can refer to them.

    If anything is unclear, please free feel to let me know.

    Best Regards,


    Lily Wu [MSFT]
    MSDN Community Support | Feedback to us