1

I'm building a WPF library in Visual Studio 2015, and build never completes. In build output diagnostic level I can see the last task launched by msbuild is

calling 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\ILAsm.exe' with /nologo "/out:[PathtoOutputDLL]" "[PathtoILfile]" /DLL "/resource=[PathtoResfile]"  /debug   (TaskId:65)

I can see the ilasm process is hanging around, not crashed, but nothing happens. If I forcefully stop the build by killing the msbuild and launch the same command in a console, it works, fast, outputs Operation completed successfully

I've used Process Monitor to get a handle on what's happening, and I found something weird-ish, when ilasm is successful (run from console), the process is named ilasm.exe and when it's a failure it's named ILAsm.exe (notice the case change), I don't see why, especially that the path to the exe are the same? There is something in the Process event log that mentions prefetch of the binary to be run:

Success: "IRP_MJ_READ","C:\Windows\Prefetch\ILASM.EXE-FD82B157.pf","SUCCESS","Offset: 0, Length: 82 642, Priority: Normal"

Failure: "IRP_MJ_READ","C:\Windows\Prefetch\ILASM.EXE-FD82B157.pf","SUCCESS","Offset: 0, Length: 82 844, Priority: Normal"

Same file but different sizes all of a sudden ?

4

1 回答 1

0

我仍然不知道它为什么会卡住,但我已经将其范围缩小到第三方 COM 互操作与 Robert Giesecke 的 UnmanagedExports 之间的不良关系。

该特定类库依赖于第三方 COM 互操作,并且它在由 UnmanagedExports 修改的 IL 中的存在以某种我不知道的方式触发了 ILASM 或 UnmanagedExports。但是解锁构建的一件事是将“嵌入互操作类型”设置为 false,以便 COM 互操作不会最终出现在输出中,然后 UnmanagedExports 可以正常工作。

于 2015-11-23T13:39:08.580 回答