Confusion managing web solution in VS2012

Topics: Installing Orchard
Aug 11, 2013 at 9:56 PM
Hi all,

I have a website re-design in mind, and I plan to use Orchard. I've downloaded Orchard.Web.1.7 and gone through the initial site setup successfully, but I'm now confused about how to open the site in Visual Studio.

I seem to have two options:

1) Extract Orchard.Web.1.7.zip to a new website folder and then open the files using the File -> "Open Website" menu option. This allows me to view and manage some of the files in the folder, but does not open it as a VS solution, with each module represented with its own VS project file. This "website" also fails to build (null ref exception with Lucene).

2) Download and extract the full source zip file instead. This allows me to open the solution properly in VS2012 (via "Open solution..."), but I was horrified to see that the output directory is over 1GB in file size! It also contains many libraries that I feel I do not need (spec tests, WarmUpStarter(?) etc).


Question:

Which of the above methods is best suited to my needs? I like being able to manage my websites in VS, but also appreciate that this is a CMS after all, and maybe I should be going about this differently?

Any advice would be appreciated.

Thanks,
Nick
Developer
Aug 12, 2013 at 1:29 AM
If you are planning to do development (module or theme), I'd go with the full source solution and remove the projects you and Orchard don't need. Once your modules and themes are ready to be deployed, package them up for installation with other Orchard installations (using the Orchard.exe command line tool), or use the ClickToBuild.cmd file to generate output folders. These folders contain pretty much as much and as less what you find in Orchard.Web.zip. To include your and 3rd party modules and themes, be sure to include them as part of Orchard.sln before building the output.

When you open ClicktoBuild.cmd with Notepad, you'll see that it gotos build.cmd, which in turn executes a build command with a parameter set to "Build".
This is the name of a target you'll find in Orchard.proj (in the same directory). You'll see that Build will do the following:
<Target Name ="Build">
    <CallTarget Targets="Clean"/>
    <CallTarget Targets="Compile"/>
    <CallTarget Targets="Test"/>
    <CallTarget Targets="Package"/> 
  </Target>
If you want to skip the unit tests, change the target parameter in build.cmd to "FastBuild":
<Target Name="FastBuild">
    <CallTarget Targets="Clean"/>
    <CallTarget Targets="Compile"/>
    <CallTarget Targets="Package"/>
  </Target>
This way, you can also choose to build a precompiled package using the "Precompiled" target if you want.
Aug 12, 2013 at 1:46 PM
Hi. Thanks for getting back to me.

I understand what you're saying, but don't people ever want the main website (Orchard.Web.1.X) in a VS solution? I really don't like opening the files as a "website" solution...

Surely there are certain files that exist outside of the context of a module (the Orchard main page template, for example)? How would you go about making changes to something like this?
Coordinator
Aug 12, 2013 at 8:33 PM
  1. You could make your own solution for that, although it's a lot simpler to open it as a web site, and reduces the confusion about it being buildable.
  2. Any template override should be done in a theme.
Aug 12, 2013 at 9:33 PM
Thanks a lot for clarifying, guys. I think I have enough to get me started...!

Cheers.
Nick