This project is read-only.

Referencing custom libraries from modules

Topics: Writing modules
May 27, 2013 at 8:12 PM
I have a library project which I use from my module.
In my VS solution this dll is referenced as project. Also I have it in the module's web.config
    <compilation targetFramework="4.0">
        <add assembly="Base.Web"/>
When I start the website there is a file Base.Web.dll in the dependencies folder. It is not binary but some xml. The website won't start with an error not being able to load the library.
System.BadImageFormatException: Could not load file or assembly 'Base.Web,...'
When I directly copy it to the dependencies folder, it works well.
I remember it worked with this configuration without having to copy it until I added some code to the library.

What should I do to fix this?
May 28, 2013 at 1:57 AM
Do not reference library projects as projects. Either that dependency is an Orchard module, and you can reference it as a project, or it is not and it must be compiled separately, and referenced as a dll (that you usually drop into a lib folder under your module).