Questions tagged [peverify]

PEVerify is a tool that checks if .NET assemblies meet type safety requirements.

The PEVerify tool helps developers who generate Microsoft intermediate language (MSIL) (such as compiler writers, script engine developers, and so on) to determine whether their MSIL code and associated metadata meet type safety requirements.

32 questions
3
votes
1 answer

Changing callvirt to call in IL

During some experiments with IL, I attempted to change callvirt calls in an assembly to call methods. Basically what happens is that I have an inheritance chain with member functions that I am calling. Basically the call is similar to…
atlaste
  • 30,418
  • 3
  • 57
  • 87
2
votes
1 answer

PEVerify in code?

Possible Duplicate: Is there an API for verifying the MSIL of a dynamic assembly at runtime? I'm dynamically generating an assembly using Reflection.Emit and the like. For a unit test, I'd like to PEVerify my IL. I can do it from the command…
Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273
2
votes
1 answer

How can I ensure an unverifiable .NET assembly is valid?

.NET apps are distributed in files called assemblies, which contain metadata and common intermediate language (CIL) code. The standard that .NET conforms to, ECMA-335, II.3, notes a distinction between two similar-sounding terms: An assembly is…
Joe Sewell
  • 6,067
  • 1
  • 21
  • 34
2
votes
1 answer

What does "Illegal use of type 'void' in signature" mean?

I have a compiler that's producing an assembly. When I load the assembly and try to run a method on an object whose class is in that assembly, it throws an exception: System.InvalidProgramException: Common Language Runtime detected an invalid…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
2
votes
2 answers

Invoke developer command prompt from python

How can I invoke a Developer Command Prompt that comes with Visual Studio 2013 and execute my peverify commands in it from a python script. I am using python 3.4. I was able to execute commands in windows command prompt using subprocess but dont…
Nevin Raj Victor
  • 2,924
  • 3
  • 23
  • 37
1
vote
0 answers

peverify bugs fixed in .NET 4?

I have VS .NET 2010 installed, and a class library targeting .NET 3.5. The simple C# fragment below generates verifiable IL under .NET 4.0's peverify, but the IL does not verify using .NET 3.5's peverify. Were there any peverify bugs fixed in this…
naasking
  • 2,514
  • 1
  • 27
  • 32
1
vote
2 answers

Question about peverify errors

When I run the peverify utility against my .NET exe, I get a few errors (classes, methods renamed): [IL]: Error: [myapp.exe : namespace.class::method1][offset 0x00000027] Instruction cannot be verified. [IL]: Error: [myapp.exe :…
Jon Tackabury
  • 47,710
  • 52
  • 130
  • 168
1
vote
1 answer

peverify: Method is not visible?

I'm not sure what I'm doing wrong here. I'm generating a dll that uses code in my current assembly. Here's a simplified version containing only the code that that's causing the issue. static void Main() { Swift.Init(); } public static class…
vexe
  • 5,433
  • 12
  • 52
  • 81
0
votes
2 answers

PEVerify MD Error: 0x8013124C

I get this 'error' when running PEVerify on a custom generated assembly. [MD](0x8013124C): Error: Method has a duplicate, token=0x06000023. [token:0x06000021] [MD](0x8013124C): Error: Method has a duplicate,…
leppie
  • 115,091
  • 17
  • 196
  • 297
0
votes
0 answers

Why does peverify give me an "unable to resolve token" error for plain and simple managed code?

I wonder why peverify /quiet gives me this error: [IL]: Error :[QuickFIXn.xyz.dll : QuickFIXn.MessageFactories+DefaultMessageFactory::GetTransportDataDictionary][offset 0x00000039] Unable to resolve token. for this piece of managed code (omitting…
Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156
0
votes
0 answers

PEVerify Defect: It reports "Type load failed" on valid class compiled with csc.exe for compact framework

A trivial class: public class TestClass : System.ServiceModel.Security.SecurityCredentialsManager { } When compiled using csc against the MS CompactFramework v3.5 will result in a dll that fails to pass peverify, resulting in a "Type load…
Roger
  • 51
  • 3
0
votes
1 answer

C# System.TypeInitializationException When Generic Types used

I am getting a System.TypeInitializationException in C# when i try to call the following: List buyShopItemList = new List(0); BuyShopItem is in an external assembly and contains the following: namespace GameProtocol { …
Timon M
  • 11
  • 2
0
votes
1 answer

How to correct Stack UNDERflow error

I get an InvalidProgramException when trying to execute a particular procedure in an application I am working on when it has been compiled with optimizations (Visual Studio 2015). I used PEVerify to see what it says about the problem, and it tells…
jmoreno
  • 12,752
  • 4
  • 60
  • 91
0
votes
1 answer

Can PEVerify tell me the severity of each error?

I'm modifying an assembly using Mono.Cecil, and I want to check it for validity (whether the result will run at all). I'm trying to use PEVerify, but I'm having a problem. It was designed for ensuring code is verifiable, so it just says ERROR…
GregRos
  • 8,667
  • 3
  • 37
  • 63
0
votes
1 answer

PEVerify fails on explicit interface property when the interface is in a Portable Class Library

I'm emitting a class that explicitly implements a simple interface property with a get method. There are no problems so long as the interface is not defined in a portable class library. However, when moving the interface to a PCL and using only…
Eric
  • 33
  • 2