locked
Moles is not working with MVC3 (System.Web.Mvc.dll) RRS feed

  • Question

  • I just started investigate moles framework and I get not really good experince from start. By some reason I can't generate moles for the System.Web.Mvc.dll (v.3)

    I will try to explain my problem step-by-step

    1. In just created empty solution I adding two project's (Asp.Net MVC 3 and Test).
    2. Add C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\System.Web.Mvc.dll) reference in test project.
    3. Add Moles Assemly (in VS2010) for System.Web.Mvc.dll in my test project.
    4. Build project.

     

    In step 4 I get a following error

        ------ Build started: Project: SampleMvcApplication.UnitTests, Configuration: Debug Any CPU ------
    Microsoft Moles v0.94.51023.0 - http://research.microsoft.com/moles - .NET v4.0.30319
    Copyright (c) Microsoft Corporation 2007-2010. All rights reserved.

    00:00:00.00> moles
    Moles : info : metadata : ignoring reference D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication.UnitTests\MolesAssemblies\System.Behaviors.dll
    Moles : info : metadata : ignoring reference D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication.UnitTests\MolesAssemblies\System.Moles.dll
    Moles : info : metadata : ignoring reference D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication.UnitTests\MolesAssemblies\System.Web.WebPages.Moles.dll
    Moles : info : configuration : diagnostic is on
    Moles : info : metadata : loading C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
    Moles : info : compilation : output assembly name: System.Web.Mvc.Moles
    Moles : warning : metadata : failed to load module System.Web.Mvc.dll:
    Moles : warning : metadata : Inheritance security rules violated by type: 'System.Web.Mvc.CompareAttribute'. Derived types must either match the security accessibility of the base type or be less accessible.
    Moles : warning : metadata : Inheritance security rules violated by type: 'System.Web.Mvc.RemoteAttribute'. Derived types must either match the security accessibility of the base type or be less accessible.
    Moles : error : code : assembly contains no types or failed to load properly
    00:00:00.20> moles generator 1 errors, 3 warnings
    C
    :\Program Files (x86)\Microsoft Moles\bin\Microsoft.Moles.targets(79,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft Moles\bin\moles.exe" @D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication.UnitTests\obj\Debug\Moles\moles.args" exited with code -1005.
    ------ Build started: Project: SampleMvcApplication, Configuration: Debug Any CPU ------
    Microsoft Moles v0.94.51023.0 - http://research.microsoft.com/moles - .NET v4.0.30319
    Copyright (c) Microsoft Corporation 2007-2010. All rights reserved.

    00:00:00.00> moles
    Moles : info : metadata : loading C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll
    Moles : info : compilation : output assembly name: System.Web.WebPages.Moles
    Moles : info : code : found 71 types
    Moles : info : code : visibility: exported or assembly(System.Web.WebPages.Moles)
    00:00:00.34> code generation
    Moles : info : code : generating code at D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication\obj\Debug\Moles\swwp\m.g.cs
    00:00:00.46> stubs generation
    Moles : info : code : generated 23 stub types
    00:00:00.86> moles generation
    Moles : info : code : generated 33 mole types
    00:00:01.70> compiling
    Moles : info : compilation : Moles assembly: D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication\MolesAssemblies\System.Web.WebPages.Moles.dll
    00:00:02.43> moles generator 0 errors, 0 warnings
    SampleMvcApplication -> D:\Samples\Moles\SampleMVC\SampleMvcApplication\SampleMvcApplication\bin\SampleMvcApplication.dll
    ========== Build: 1 succeeded or up-to-date, 1 failed, 0 skipped ==========

    I investigated all topics that I found but nothing helps ( I even did't found some good answer and explanation about this problem.)

    Please advise. Thanks.

    Thursday, October 6, 2011 7:19 AM

Answers

  • Hello, The Pex and Moles team now monitors their forums on Stack: http://stackoverflow.com/questions/tagged/pex-and-moles Thanks Chuck
    Tuesday, October 18, 2011 1:43 AM