Working from source with multiple sites?

Topics: Customizing Orchard, Writing modules, Writing themes
Oct 28, 2011 at 7:16 PM

I'm getting started with the latest rev of Orchard and I'm confused about the best work flow to use when working from source (VS2010) and using multiple sites.

Initially, I tried just publishing Orchard.Web to a project folder, creating a new solution for the web application project I'm working on, and planned on deploying from the Orchard source solution to the web folder if I needed to make any changes there (which is unlikely). This sort of works - after having to add references to DLLs in the source folder that aren't copied over when publishing Orchard.Web from VS (why is that?). However, every tutorial I've found encourages just adding my themes, modules, etc to the big beast that is Orchard.sln.

This seems to imply that, for each web application I'm working with, I need to either keep a separate copy of the Orchard source (blech) solution, or add all of my modules and themes to one copy of the Orchard solution. However, when I'm working on 10-20 different apps which are completely unrelated to each other, I really don't want to add ALL of the code from each site into one solution.

Suggestions?

Coordinator
Oct 28, 2011 at 7:40 PM

Well, that's how I work: I just clone the repository for the app itself, and usually create a specific solution file that starts as a copy of orchard.sln, where I add the projects for the additional modules and themes that I use on tis particular project. Those modules, when I can, are also being updated through source control. Doing updates of those is just super-easy.

I don't understand what you're saying about having to add references that are never copied.

Of course, any suggestions of a better workflow are welcome.

Oct 28, 2011 at 7:51 PM

Re: references: The published Orchard.Web.csproj contained references to

Orchard

Orchard.Core

Orchard.Framework

Orchard.WarmupStarter

Those files were present in the target bin folder after the publish, but the csproj didn't reference them correctly so they appeared in VS as broken references.

I'm not sure I have a good suggestion for a better workflow at the moment, but having to keep (number of sites I'm working on) copies of the not-small Orchard source in my VCS is not exactly pretty.

It'd be a lot easier if we could, say, add symbolic links from the Themes and Modules folders to other project folders so that it doesn't really all have to be in one place.

Thanks!



Coordinator
Oct 28, 2011 at 8:01 PM

With the full source code? After you built? That's very odd. Never seen it.

So why can't you add symbolic links?

Oct 28, 2011 at 8:35 PM

Yes, that's with the full source. To be clear: I opened up Orchard.sln, built everything, and published Orchard.Web to a local IIS folder. I then opened that orchard.web.csproj, where I saw the broken references.

Symbolic links: okay, I'll bite: how? (insert confused look here)

Coordinator
Oct 28, 2011 at 8:46 PM

Ah, I see. Yes, this is normal. You should never open that deployed csproj. In fact, what's not normal is that it would get deployed at all. That's the bug.

Nov 5, 2011 at 11:38 AM

Hi all,

I have the same problem i think.

I have recently started to look at orchard so please bare that in mind, I am trying to create a new theme and then a module. Basicall i am trying to find the best and easies method for setting things up.

bertrandleroy, what is the best method therefore to build new themes and modules for sites as i dont want to change anything to the main source i just want to code and debug themese and modules. I have tried a few ways but always end up in a mess with references as mentioned above. I have read lots of the docs and other peoples blogs but to no avail.

Should i, (i think this is how you do it from your above statement) download the source per each new website (seems like overkill when i only want to change the orchard.web project) then have i have orchard folder and 2 sub folders lib and src; from there open the solution inside src that contains the 60 or so projects. surely orchard.web references should be able to be all included in the bin so i can copy just the orchard.web which it looks like this guy has done here: http://www.deepcode.co.uk/2011/05/real-world-orchard-cms-part-2-creating.html even though he states to use the full source he only has 2 projects in the solution; if i am missing something please help i have spen many hours trying different approached only to have references messed up and dll's going missing.

Thanks Jonathan

Coordinator
Nov 7, 2011 at 8:08 PM

You don't have to use the full source code, but then you won't be able to compile from VS (but you shouldn't need to).