Module development seems to break

Jan 4, 2011 at 6:32 PM

I feel like I'm heading down a weird and wrong path.  I have been trying to do a couple of custom modules for Orchard, and following the examples works up to a point, but I keep running into weird build errors after a while (doesn't happen right away) where it says that my content type exists in two places (one being in the temp directory, the other in the App_Data/Dependencies directory).  I tried a number of different things, including working w/ the Orchard source files, separating my module out into a totally different directory structure and just referencing it, making symbolic links... everything I could think of.  

I even tried developing it outside the orchard environment entirely, then packaiging it using the command line tool and importing, which also didn't work (got a error that the manifest was missing, even though the Module.txt file was present, and that (according to the docs) is the manifest).


Mar 1, 2011 at 5:02 PM


I get this duplicate error every once in a while as well. Did someone find a fix for this?


Mar 30, 2011 at 7:01 AM
Edited Mar 30, 2011 at 7:01 AM

I have had similar issue with Mello.ImageGallery modules. The source of that problem was that the module name (Mello.ImageGallery) differs from assembly name (ImageGallery) and ASP.NET compiled module views to temporary assembly with duplicate classes from ImageGallery and the exception looked like

The type 'Mello.ImageGallery.Models.ImageGalleryPart' exists in both '
c:\Users\...\AppData\Local\Temp\TemporaryASP.NET Files\orchardlocal\c419bb10\4c267aaf\App_Web_3abu0fum.dll'
and 'd:\..\Source\Orchard\src\Orchard.Web\App_Data\Dependencies\ImageGallery.dll'

When I renamed module assembly to match module name, that extra assembly was gone along with that exception. Try that. Also, looking inside dll that causes the exception with Reflector may give some clues. Maybe messing with this will also help:

  <Target Name="AfterBuildCompiler" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />

I hope Orchard gurus will give us some insight on what's exactly breaking when the assembly name is different from module name.