Package Orchard CMS module without source code - orchardcms

when creating a new module with
package create
it creates it using source code *.cs files, so as a result nuget package does not contain binaries, the source only
Is it any parameter or option to precompile module, so instead of source files, it will precompile DLL?
The only option I found, is to open package file (which is ZIP file) and update content manually, but this is not best solution

By design, Orchard modules are source code, to ensure that they are friendly to modification. If you want to deploy something without source code, it should be the whole site, not just one module. This can be done by building precompiled.

Related

Building VTK from source (trunk)

I am trying to build VTK from sources as it is a dependency to PLC library which I am trying to build.
I use ccmake.. to select all relevant groups to be built (including Group_imaging), and I can build VTK with no particular problems.
Though, I cannot find vtkImageLoader2.h (and many other headers) anywhere in the system. As these files are required by PCL, this is a problem.
I checked that the original file exists inside the source tree, and it is indeed inside IO/Image.
I can't understand why the file is not being build and deployed to /usr/local/include, I made sure all modules (groups) are ON in ccmake.
Is this file deprecated, or am I missing the way to deploy it?
EDIT: I discovered that the file belongs to module vtkIOImage that is part of the "StandAlone" group. The StandAlone group is set "ON" when i run ccmake. Is this a bug in the build scripts of VTK?

Orchard CMS build script - excluded module projects included in build

I'm using Orchard 1.6 and have a question regarding the build batch file.
When run, the script builds every module within the "Modules" directory, regardless of whether the module project is included in the VS solution.
Is there a setting somewhere so only module projects are built if the corresponding project is loaded in VS? (I'd like to prevent excluded/unloaded projects from being part of the build)
Thank you for any pointers.
Replace the script so that it builds based on the solution instead of the orchard.proj file.

How does Orchard resolve references in modules?

The documentation (here and here) is notably lacking information on how references in modules are resolved:
References Resolution
(TODO: Explain how Orchard figures out references by looking at the "References" section of the csproj file as well as looking at additional assembly binaries dropped in each module "bin" directory)
Unfortunately, this is exactly the information that I need. I have created a custom module that has a reference to a custom-built, in-house DLL. When I try to use a class from this DLL, I get the following Exception:
Could not load type 'Custom.MyClass' from assembly 'Custom, Version=[version], Culture=[culture], PublicKeyToken=[token]'.
So, my question is thus: What does Orchard do with module references, and is there anything special I need to do to have Orchard pick up my module's references?
EDIT: Looks like some better information can be found in this blog post and its comments. However, my custom assembly already exists in src\Orchard.Web\App_Data\Dependencies, and I'm still getting the error.
EDIT2: We have a copy of the custom DLL in the lib folder, so I tried referencing that one instead (as we have another module that does so successfully), but still no change.
EDIT3:: In reference to the previous two edits, it's not copying from the lib folder to the App_Data\Dependencies folder. I just added a new DLL to the lib folder and referenced it, and it didn't appear in the Dependencies folder. I think the current Custom.dll isn't replacing the one that's there, which is why I'm getting the error I am. But why isn't Orchard copying into the Dependencies folder?
In order to have Orchard to use your custom module you need to have it on path: your_web_application_path/Modules/your_custom_module, we are using sym links to achieve that.
Then your main module (web application) should see your custom module. If you are adding new module to existing orchard app, you probably need to enable it by hand from admin panel/modules menu. For new installations you could add feature enable directive to your recipe and add dependency to main module.txt file (assuming you want your module always on).
Another trouble shooting tips:
make sure your module build path is set to bin/ folder (not some bin/debug etc.)
make sure your module is really an orchard module (have module.txt file) and is seen in admin panel/modules
make sure it is enabled, new modules are by default disabled
make sure referenced libraries are referenced from static folder I mean not from someting like bin which is clean up during rebuild

Orchard CMS Custom Module Project File

I have an existing solution (multiple projects, one MVC web project) that I'm trying to wrap into an Orchard module.
All documentation says that the web csproj should be at the root under my module directory (eg Modules/MyModule/MyWeb.csproj).
However, I have an existing solution structure where the sln file sits at the top level and each csproj file (and project content) sits in its own directory (the standard solution structure when you build a multi-project app in Visual Studio).
Is there a way I can tell my Module.txt file that the Orchard Module csproj is under MyModule/MyWeb/MyWeb.csproj? I'd prefer to not restructure the whole solution.
Thank you.
Note: As a point of clarification, it is not ~/Modules/MyModule/MyWeb.csproj but ~/Modules/MyModule/MyModule.csproj. The Folder name of the Module must match the file name of the project (before .csproj). This is enforced by the Dynamic Extension Loader, which requires ~/Module/{ModuleId}/{ModuleId}.csproj. (A similar approach is required for themes.)
The only potential way to do this is to write a custom module that follows the above that contains a custom loader. Within your module, create your own implementation of IExtensionLoader, and register it with Autofac. However, I don't know if it would work; I've never tried.
You will probably have an easier time reorganizing your solution.

Orchard module doesn't work when built with VS2012

I've made a hello world module for orchard following this tutorial http://docs.orchardproject.net/Documentation/Building-a-hello-world-module
I've opened up the csproj in VS2012 and changed the projecttype guids to be MVC https://stackoverflow.com/a/12811015/828859
When I build the module in MVC orchard uses the published DLL.
When i attempt to go to the /helloworld route i get 404 resource cannot be found
When i save a file and let the dynamic compilation in orchard do it's thing it works fine.
I would like to be able to deploy with a DLL so does anyone have any ideas on the problem?
Ok, two things.
First - you won't be able to deploy your module as a single DLL. There are lots of things that do not get compiled into the DLL, eg. the Module.txt manifest. It has to be there under /Modules/<YourModuleName> (as well as module's .csproj file, .cshtml files and some more). Otherwise, Orchard won't be able to find your module.
So the source code for the module has to be there, although if you build it and the module's DLL is in /Modules/<YourModuleName>/bin folder, dynamic compilation won't kick in.
Second - module development should be done using full source code - not with the downloaded deployment package. Please read here how to get full source code.

Resources