newbie question: how to import an existing Orchard module to solution

Topics: General, Writing modules
Oct 16, 2013 at 8:40 PM
Edited Oct 16, 2013 at 8:41 PM
Hi,
I downloaded the latest Orchard code and built it successfully in VS 2012. As i want to try some sample modules with source code, i added the module project to the Solution in VS. The build went ok, however, i can't see the module is listed on the site.

Can anyone tell me how to import an existing project to Orchard without installing its nuget package? or without codegening a new module and manually adding source files?

Thanks a lot.

Wei
Developer
Oct 16, 2013 at 9:52 PM
Just place the module's full source under Orchard.Web/Module/ModuleId where ModuleId is the same as the module's project file's name. If the module also has a Module.txt as it should you'll see it appear.
Oct 16, 2013 at 10:26 PM
Edited Oct 16, 2013 at 10:27 PM
you mean copy all the module source folder to under Orchard.web instead of doing "add existing project" in VS?
Developer
Oct 16, 2013 at 10:32 PM
Not "instead": you could still add it to the sln but it's not mandatory for Orchard to notice that the module is there.
Oct 17, 2013 at 8:29 PM
Hi, Piedone,
Copy the code and then do "add existing project" works. I don't know why just "add existing project" failed to work although the files are still copied as i checked.
Thanks a lot for your help.
Oct 18, 2013 at 3:57 PM
i found what really was my problem,
this link:
https://orchard.codeplex.com/workitem/18610

The project folder name is essential to make the module work.

A more real world example is downloading the latest source of a module from codeplex (say http://orchardimagefield.codeplex.com/SourceControl/list/changesets), copying the folder into your file system (the folder is named with the changeset version), but not renaming the folder to match what module.txt specifies, in this case Contrib.ImageField. It appears you can enable the module, but it won't work until the folder name matches.

Hopefully Orchard newbies will not repeat my mistake.