How to PEVerify Silverlight

2/16/2012 By Marco Kesseler 0 comments

Ever ran PEVerify on a Silverlight assembly, and you got something like this?

[….many errors snipped…]

[IL]: Error: [D:\SVN\Components\bin\PDFRasterizer.NET\SL4\STANDARD4\TallComponents.PDF.Rasterizer.dll : TallComponents.Images.ImageProperties::.ctor] [HRESULT 0x80070002] - The system cannot find the file specified.

[IL]: Error: [D:\SVN\Components\bin\PDFRasterizer.NET\SL4\STANDARD4\TallComponents.PDF.Rasterizer.dll : TallComponents.Images.ImageProperties::get_TransparentColor] ; [HRESULT 0x80070002] - The system cannot find the file specified.

[HRESULT 0x80070002] - The system cannot find the file specified.

196 Error(s) Verifying TallComponents.PDF.Rasterizer.dll

Look in Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0 (or whatever version you are using). Copy all assemblies to the same folder as your Silverlight assembly. Run PEVerify again, et voila:

Microsoft (R) .NET Framework PE Verifier.; Version 4.0.30319.1

Copyright (c) Microsoft Corporation.; All rights reserved.

All Classes and Methods in TallComponents.PDF.Rasterizer.dll Verified.

Assuming of course that you use an up-to-date version of peverify and that your assembly in fact does not contain any issues that PEVerify checks for.