locked
Error generating Moles for assembly

    Question

  • I am getting an error while trying to generate the Moles types for my assembly. Here is the error code returned:

     
    Moles: processing WMS.NG.Web.FPCT.Modules.Layout.moles - generating mole types and stub types
    moles target .net runtime: v2.0.50727
    moles target framework version: v3.5
    >C:\Program Files (x86)\Microsoft Moles\bin\moles.exe "C:\WMS_2008\Development\Dev-FT-Branch - FreedomPort 1\Main\SourceNG\TestProjects\UnitTestProjects\WMS.NG.Web.FPCT.Modules.Layout.Tests\obj\Debug\Moles\WMS.NG.Web.FPCT.Modules.Layout.g.vs.moles" /disabledeploy /targetframeworkversion:v3.5 /toolsversion:3.5 /intermediatepath:"C:\WMS_2008\Development\Dev-FT-Branch - FreedomPort 1\Main\SourceNG\TestProjects\UnitTestProjects\WMS.NG.Web.FPCT.Modules.Layout.Tests\obj\Debug\Moles" /msbuildpath:C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe /outputpath:"C:\WMS_2008\Development\Dev-FT-Branch - FreedomPort 1\Main\SourceNG\TestProjects\UnitTestProjects\WMS.NG.Web.FPCT.Modules.Layout.Tests"
    Microsoft Moles v0.92.50603.1 - http://research.microsoft.com/pex - .net v2.0.50727
    Copyright (c) Microsoft Corporation 2007-2010. All rights reserved.
    
    00:00:00.00> moles
     [code] output assembly name: WMS.NG.Web.FPCT.Modules.Layout.Moles
     [code] visibility: exported or assembly(WMS.NG.Web.FPCT.Modules.Layout.Moles)
     [metadata] loading C:\WMS_2008\Development\Dev-FT-Branch - FreedomPort 1\Main\SourceNG\SilverlightModules\WMS.NG.Web.FPCT.Modules.Layout\Bin\Debug\WMS.NG.Web.FPCT.Modules.Layout.dll
     !warning! [metadata] failed to load module WMS.NG.Web.FPCT.Modules.Layout.dll:
     !warning! [metadata] Could not load file or assembly 'WMS.NG.Web.Infrastructure, Version=4.1.3775.5, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
     !warning! [metadata] Could not load file or assembly 'Microsoft.Practices.Composite, Version=2.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
     !error! [code] assembly contains no types or failed to load properly
    00:00:00.54> moles generator 1 errors, 3 warnings
    
    
    moles compiler returned error while loading the assembly (-1005 - 0xfffffc13)
    Moles: processing WMS.NG.Web.FPCT.Modules.Layout.moles - generation finished
    moles generation failed
    -- Moles update finished
    

     

    Thank you,

    Do I need to add something to the ".moles" file? Something else?
    Cindy Kee, CNC Consulting
    Friday, June 25, 2010 6:48 PM

All replies

  • !warning! [metadata] failed to load module WMS.NG.Web.FPCT.Modules.Layout.dll:
    !warning! [metadata] Could not load file or assembly 'WMS.NG.Web.Infrastructure, Version=4.1.3775.5, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    It seems that an assembly is missing. You can turn on fusion logging with fuslogvw to understand which assembly is missing. You probaly want to start with WMS.NG.Web.Infrastructure.


    Jonathan "Peli" de Halleux - Follow Pex and Moles on Facebook!
    Saturday, June 26, 2010 5:38 AM
  • But it's not missing. The Layout module builds fine in its project with both references listed in the References section of the project. Also, both dependencies are listed in References section of the test project where I am trying to use Moles. In fact, this test project built fine until I wanted to add Moles to it. I just did an Add New Item... to the project and told it to add a "Moles and Stubs for Testing" item, named it with the project that I wanted to create moles and stubs for, and then got these messages. Did I do something wrong? (Oh, and I am doing this from VS2008 since I read that Pex/Moles support VS2008 - I have the Team System edition.)

    Where do I run that fuslogvw command? In a VS2008 command line window?

     

    Thanks,

     


    Cindy Kee, CNC Consulting
    Tuesday, June 29, 2010 9:15 PM
  • You seem to have done everything correctly. Please update the .moles file as follows to get more logging output:

        <Moles ... Diagnostic="true" Verbosity="Noisy">
            <Assembly ... ReflectionOnly="true"/>

    then save the file which should trigger the generation.

    * note: in the future, you can simply right click on any assembly reference and select 'Add Moles Assembly' to add the .moles file.


    Jonathan "Peli" de Halleux - Follow Pex and Moles on Facebook!
    Thursday, July 1, 2010 1:00 AM