locked
Build Moles for .NET 4.0 system assemblies fails

    Question

  • Hi all.

    We are using Moles some time ago, but now we change our develop machines and when we try to compile the solution, we are getting errors in code generated by Moles library. After some investigation about what causes that, we find that Moles cannot compile some system moles assemblies: System.Moles.dll and System.ServiceModel.dll

    We have the problem with both Windows 7 professional 64bits and 32bits and we test it in several machine configurations, with the same results.

    Here are the output of the command "build_moles_net4.cmd". The same errors that you can see here, we are getting in the solution compilation, and the errors in the System.ServiceModel.Moles.dll are similar. We are workaround that by copying the generated assemblies from old machines, and putting them in C:\Program Files\Microsoft Moles\MolesAssemblies, behind a folder named like the assembly. Thank you very much:

    C:\>setlocal

     

    C:\>echo ==================================== 

    ====================================

     

    C:\>echo Building Moles Assembly for .NET 4 System Assemblies 

    Building Moles Assembly for .NET 4 System Assemblies

     

    C:\>echo ==================================== 

    ====================================

     

    C:\>set MOLES_BIN_PATH=C:\Program Files (x86)\Microsoft Moles\bin\ 

     

    C:\>set MOLES_OUTPUT_PATH=C:\Program Files (x86)\Microsoft Moles\bin\..\MolesAssemblies 

     

    C:\>set MOLES_INTERMEDIATE_PATH=C:\Users\SERGIO~1.CAS\AppData\Local\Temp\Moles 

     

    C:\>pushd C:\Program Files (x86)\Microsoft Moles\bin\ 

     

    C:\Program Files (x86)\Microsoft Moles\bin>moles.exe /x86 /ronly /nocc /f /imga /exported /clean /cache /admin /ip:"C:\Users\SERGIO~1.CAS\AppData\Local\Temp\Moles" /op:"C:\Program Files (x86)\Microsoft Moles\bin\..\MolesAssemblies" .net4 

    Microsoft Moles v0.94.51023.0 - http://research.microsoft.com/moles - .NET v4.0.30319

    Copyright (c) Microsoft Corporation 2007-2010. All rights reserved.

     

    Generating 4 Moles assemblies with 4 concurrent processes

    3:start> mscorlib

    4:start> System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL

    5:start> System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL

    6:start> System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86

    4:end> System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL Success (0 - 0x0)

    5:end> System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL error while compiling the generated code (-1007 - 0xfffffc11)

    3:end> mscorlib Success (0 - 0x0)

    6:end> System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86 Success (0 - 0x0)

    deleting C:\Users\SERGIO~1.CAS\AppData\Local\Temp\Moles

    ---------------------------

    C:\Program Files (x86)\Microsoft Moles\bin\moles.x86.exe "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" /cache /cleanintermediatepath /disablecodecontracts /elevated /forceintermediatepath /forcereadonly /ignoremissinggacassembly /leaf /exportedtypes /intermediatepath:C:\Users\SERGIO~1.CAS\AppData\Local\Temp\Moles\s /outputpath:"C:\Program Files (x86)\Microsoft Moles\bin\..\MolesAssemblies" /reflectiononly /targetx86 -- Success (0 - 0x0)

    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:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll (reflection only)

      Moles : info : compilation : output assembly name: System.Moles

      Moles : info : code : found 937 types

      Moles : info : code : visibility: exported or assembly(System.Moles)

      00:00:01.02> code generation

        Moles : info : code : generating code at C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.cs

        00:00:01.17> stubs generation

          Moles : info : code : generated 480 stub types

        00:00:02.31> moles generation

          Moles : info : code : generated 664 mole types

      00:00:09.18> compiling

    --- Output

    Compilaci¢n iniciada a las 04/04/2011 12:58:51.

    Proyecto "C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj" en nodo 1 (destinos predeterminados).

    PrepareForBuild:

      Creando directorio "b\".

      Creando directorio "o\".

    GenerateTargetFrameworkMonikerAttribute:

    Se omitir  el destino "GenerateTargetFrameworkMonikerAttribute" porque todos los archivos de salida est n actualizados respecto a los archivos de entrada.

    CoreCompile:

      C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /unsafe+ /nowarn:1587,1591,1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /doc:b\System.Moles.xml /define:TRACE /reference:"C:\Program Files (x86)\Common Files\Microsoft Shared\ExtendedReflection\0.94.51023.0\bin\Microsoft.ExtendedReflection.dll" /reference:mmf="C:\Program Files (x86)\Microsoft Moles\PublicAssemblies\Microsoft.Moles.Framework.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll" /debug:pdbonly /keyfile:m.g.snk /optimize+ /out:o\System.Moles.dll /target:library m.g.cs "C:\Users\sergio.castillo\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cs"

    m.g.cs(251374,33): error CS0115: 'System.Net.Moles.SFileWebResponse.Dispose(bool)': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

    m.g.cs(251575,30): error CS0115: 'System.Net.Moles.SFileWebResponse.SupportsHeaders': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

    m.g.cs(255264,33): error CS0115: 'System.Net.Moles.SHttpWebResponse.Dispose(bool)': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

    m.g.cs(255465,30): error CS0115: 'System.Net.Moles.SHttpWebResponse.SupportsHeaders': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

    m.g.cs(303123,33): error CS0115: 'System.Net.Moles.SWebResponse.Dispose(bool)': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

    m.g.cs(303324,30): error CS0115: 'System.Net.Moles.SWebResponse.SupportsHeaders': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

    Compilaci¢n del proyecto terminada "C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj" (destinos predeterminados) -- ERROR.

     

    ERROR al compilar.

     

    "C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj" (destino predeterminado) (1) ->

    (CoreCompile destino) -> 

      m.g.cs(251374,33): error CS0115: 'System.Net.Moles.SFileWebResponse.Dispose(bool)': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

      m.g.cs(251575,30): error CS0115: 'System.Net.Moles.SFileWebResponse.SupportsHeaders': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

      m.g.cs(255264,33): error CS0115: 'System.Net.Moles.SHttpWebResponse.Dispose(bool)': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

      m.g.cs(255465,30): error CS0115: 'System.Net.Moles.SHttpWebResponse.SupportsHeaders': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

      m.g.cs(303123,33): error CS0115: 'System.Net.Moles.SWebResponse.Dispose(bool)': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

      m.g.cs(303324,30): error CS0115: 'System.Net.Moles.SWebResponse.SupportsHeaders': no se encontr¢ ning£n miembro adecuado que invalidar [C:\Users\sergio.castillo\AppData\Local\Temp\Moles\s\m.g.csproj]

     

        0 Advertencia(s)

        6 Errores

     

    Tiempo transcurrido 00:00:00.98

     

     

     

     

    --- Environment

     

        Moles : warning : compilation : project compilation failed with exit code 1

        Moles : info : compilation : deleting C:\Users\SERGIO~1.CAS\AppData\Local\Temp\Moles\s

    00:00:10.31> moles generator 0 errors, 1 warnings

     

     

     

     

    Moles compilation FAILED - 40,8267170613398s

     

    Monday, April 04, 2011 11:36 AM

All replies

  • Nobody knows how to help us? We now have a workaround, copying the moles assemblies generated time ago, with the old develop PC's, into "C:\Program Files\Microsoft Moles\MolesAssemblies" folder... But we think that this is not the best ...
    ================================= Kash
    Friday, April 15, 2011 5:58 AM