This project is read-only.

Failure to build due to System.dll issue?

Mar 31, 2016 at 1:18 AM
Edited Mar 31, 2016 at 4:34 PM
Hello,

I am using the gripper-loom compiler to do a post-build compilation on a solution, and I'm hitting the following error whenever I add it to any project file I've tried. I have been experimenting with gripper-loom on side projects, where it has been working fabulously, but I can't seem to figure out what is different between the two setups.

Both solutions are being built on the same computer, and both reference and use a reference to the System.dll. I receive this failure whether targeting .net 4.0 or 4.5. I have not been able to repro the error in my side projects yet.

Any help on this front would be greatly appreciated. Thanks!

43>PostBuildEvent:
43> "%LOOMBIN%"\gl "C:\src\current\ProjectName\bin\debug\ProjectName.exe"
.....
43>
43> System.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
43> System.ArgumentException: Path cannot be the empty string or all whitespace.
43> at System.IO.Directory.SetCurrentDirectory(String path)
43> at Loom.Compiler.Weaver.DoCallBack()
43> System.NullReferenceException: Object reference not set to an instance of an object.
43> at Loom.Compiler.ILMutator.Rewrite(List`1 assemblyReferences)
43> at Microsoft.Cci.MutableCodeModel.MetadataRewriter.RewriteChildren(Module module)
43> at Microsoft.Cci.MutableCodeModel.MetadataRewriter.Rewrite(IAssembly assembly)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.PERewriter.Rewrite(String filename)
43> at Loom.Compiler.Gripper.Main(String[] argv)
43>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(4291,5): error MSB3073: The command "
43>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(4291,5): error MSB3073: "%LOOMBIN%"\gl "C:\src\current\ProjectName\bin\debug\ProjectName.exe"
43>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(4291,5): error MSB3073: " exited with code 2.
43>
43>Build FAILED.
43>
43>Time Elapsed 00:00:27.13
Mar 31, 2016 at 6:47 PM
Edited Mar 31, 2016 at 8:24 PM
I've identified a possible source of the error I'm seeing, which could be related to the filtering in this method inside of PERewriter
    private bool IsSystemAssembly(string assemblyname)
    {
        return (assemblyname == "mscorlib" || assemblyname.StartsWith("System"));
    }
I downloaded the source and built the project, hoping to start tinkering with this snippet and see if I could resolve the error.

Unfortunately, I am having an issue with the build at startup time, which seems to be related to something about how the project is being built. After I build (Debug, AnyCPU), I see all of the expected files ins LooM.NET\bin, but the gl.exe file fails at startup with the following error:
    C:\StephenScratch\LOOM.NET-SRC\bin>gl \src\current\ProjectName\bin\debug\ProjectName.exe

    Gripper-Loom.NET aspect weaving post-compiler
    (C) 2001-2012 by Wolfgang Schult. All rights reserverd.

    Unable to find assembly 'Loom.CodeBuilder.Gripper, Version=4.2.1340.0, Culture=neutral, PublicKeyToken=e572de6b204b1657'.
    Build failed.
However, inside of this directory, I see the following files:

C:\StephenScratch\LOOM.NET-SRC\bin>dir

03/31/2016 10:38 AM <DIR> .
03/31/2016 10:38 AM <DIR> ..
03/31/2016 10:38 AM 30,208 gl.exe
03/31/2016 09:07 AM 144 gl.exe.config
03/31/2016 10:38 AM 48,640 gl.pdb
03/31/2016 10:38 AM 122,880 Loom.CodeBuilder.dll
03/31/2016 10:38 AM 18,432 Loom.CodeBuilder.Gripper.dll
03/31/2016 10:38 AM 42,496 Loom.CodeBuilder.Gripper.pdb
03/31/2016 10:38 AM 347,648 Loom.CodeBuilder.pdb
03/31/2016 10:38 AM 14,336 Loom.Common.dll
03/31/2016 10:38 AM 30,208 Loom.Common.pdb
03/31/2016 10:38 AM 73,728 Loom.dll
03/31/2016 10:38 AM 45,056 Loom.JoinPoints.dll
03/31/2016 10:38 AM 128,512 Loom.JoinPoints.pdb
03/31/2016 10:38 AM 228,864 Loom.pdb
03/30/2016 05:19 PM 29,696 Microsoft* (ABBREVIATED BY ME)
03/31/2016 10:38 AM 5,120 Test.* (ABBREVIATED BY ME)
          47 File(s)      8,975,922 bytes
           2 Dir(s)  21,540,573,184 bytes free
Any recommendations?

Thanks!

Addendum: I've found that source version 13151 builds and does not have the 'Unable To Load Assembly' error. This one hits the system.dll issue I had before, but does also hits other errors:

C:\StephenScratch\LooM.NET-SRC-CL13151\bin>gl \src\current\Panopto\Services\DataServerService\bin\Debug\x86\PanoptoDataServer.exe

Gripper-Loom.NET aspect weaving post-compiler
(C) 2001-2012 by Wolfgang Schult. All rights reserverd.

Processing assemblies:
PanoptoDataServer
BackendLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
SharedLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
System.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
Model.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
WCFLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
StorageLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
CAPI_PInvoke.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
PoolLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
QueueLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
ExportLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
Ionic.Zip.Reduced.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
ThumbnailerLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
EncoderWorker.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
PackagerWorker.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
TranscriptionWorker.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
ServiceLib.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
QueueMasterWorker.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.
MetadataExtractorWorker.dll is not a PE file containing a CLR this.filename, or an error occurred when loading it.

Generate glue code for types:
The argument type 'System.MarshalByRefObject' cannot be converted into parameter type 'Loom.CodeBuilder.Gripper.SymbolDictionary'.