Understanding source enlistment with Visual Studio

Topics: General
Oct 14, 2011 at 5:15 PM

I'm still having problems getting to grips with work flow for developing sites with source enlistment.  I followed Betrand's video on setting up source enlistment and have hooked up to mercurial using TortoiseHg (on the default branch).  That part is all good, it's what happens next that I'm having trouble with.

If I want to develop multiple websites based on the latest source code, is the idea that you follow the enlistment process for each one or make copies for each site?

I tried the latter and made a copy of the OrchardEnlistment/src folder.  I then built and ran the (copied) solution, went through the setup pages, added various modules from the gallery and this all worked fine.  Now I want to make some changes to the new modules and debug in Visual Studio but I'm unable to see the site files.  In fact, searching for culturepicker (one of the modules I added) reveals nothing.

In Windows Explorer I can see the new site folder (Orchard.Web) and this has all of the files that I expected to find in Visual Studio.

So what's going on here?  Do I have to add the site project to the copied source solution or have I headed off in the wrong direction completely?

It strikes me that I should have a single source for the codeplex source code and for my own custom modules/themes that I might want to use across multiple sites and then separate site project directories (maybe with files links?)

Any advice would be appreciated.

Best regards

John

Coordinator
Oct 15, 2011 at 7:17 AM

You need to add the project to the solution in order for Visual Studio to show it. What I usually do is that I create a second solution for the project (so that the one under source control can stay intact) where I ad everything I need.

Oct 16, 2011 at 10:31 PM

Thanks for your reply Bertrand. 

The Orchard.Web project already appears in the solution explorer, but only contains two folders (Config and Media) which are largely empty. 

I'm unable to add the project to the same solution as there's already a project there of the same name and if I open the project file from Windows Explorer to create a new solution, I still only see the empty looking (two folders again) project in solution explorer, rather than the full project that I can see in Windows Explorer.  I'm obviously doing something in the wrong order but I'm not clear on what that is?

Best regards

John

Coordinator
Oct 16, 2011 at 11:13 PM

Not sure I understand. When I build my own custom solution, I just add to it all the projects that I need. I usually start from a copy of Orchard.sln.

Oct 17, 2011 at 9:15 AM

Ok, my fault for not being clear.  I have two problems. 

1) The first question is a general one on how to setup future projects and still benefit from source enlistment.  From what I understand you to be advocating a walkthrough would be as follows:

a) Create a new folder on your local machine and setup enlistment as per your video above.

b) Make a copy of the resulting 'src' folder (now including the various projects Orchard, Orchard.web, Tools etc)

c) Open Orchard.sln in the new copied directory and build and run the application.

d) Create a new site using the Orchard setup screen

e) Repeat steps b to d for each new site

Is that the correct process?  This still feels like it breaks the source control link?  If you copy the new solution, are you not breaking the link with source enlistment using TortoiseHg and if that's the case, what's the process to 're-synchronize' it?

2) The second question is, following the above I'm unable see the full set of files in the Orchard.Web project in the solution explorer.  I can see all of the correct files and folders in Windows Explorer (under the Orchard.Web folder), but they just don't show up in solution explorer - not if you remove and add the project, not if you open the project directly (creating a new solution) and not if you create a copy of the project folder and open the resulting Orchard.Web.csproj.

Coordinator
Oct 17, 2011 at 6:46 PM

No, that's not what I'm saying. I usually do a new clone for each new site, and create a new solution file under its src directory by copying the solution file. I think you got confused and thought that I was saying to copy the whole solution where I was referring to the sln file only.

Oct 18, 2011 at 11:36 AM

ah, I see - no I hadn't understood the solution file part.  What you're saying now makes sense, particularly since I've now solved the second part of my problem regarding the visibility of the site files within the Orchard.Web project.

What I'd failed to understand was how the code is organised.  My initial reading of Source Code Organisation lead me to believe that this was just for the source, not the subsequently generated site files.  So when I added new modules, via the gallery, I was expecting them to show up in Orchard.Web, when in fact they need to be added to the solution under the appropriate solution folder ('Modules' in this case).  I think part of my confusion is due to the fact that the physical (Module) files do sit under Orchard.Web path in the file system (see Where are Modules physically located? under the docs Dev FAQ).  I know this is not news to you, Bertrand, but I hope it helps anyone else who suffers from the same misunderstanding.

Anyway, thanks very much for your help Bertrand - I now, finally, get it.

Best regards

John