Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: On a computer that has the .NET Framework 3.5 Service Pack 1 installed, an exception is thrown when an application calls the GetOptionalCustomModifiers method or the GetRequiredCustomModifiers method on a ParameterInfo object of a generic interface


View products that this article applies to.

Symptoms

You have an application that calls the GetOptionalCustomModifiers method or the GetRequiredCustomModifiers method on the ParameterInfo object of a generic interface. When you run this application on a computer that has the Microsoft .NET Framework 3.5 Service Pack 1 (SP1) installed, an exception is thrown, and you receive an error message that resembles the following:
An unhandled exception of type 'System.ExecutionEngineException' occurred in mscorlib.dll
Additionally, event ID 1023 is logged in the Application log. This event resembles the following:Event ID 1000 may also be logged in the Application log. This event resembles the following:

↑ Back to the top


Cause

This problem occurs because of an issue in the .NET Framework 3.5 SP1.

↑ Back to the top


Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

To download this hotfix from the MSDN Code Gallery, visit the following Microsoft Web site:


Note The MSDN Code Gallery displays the languages for which the hotfix is available. If you do not see your language listed, it is because the Code Gallery resource page is not available for that language.


Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:

Note If you must have this hotfix for Windows Server 2008 or for Windows Vista Service Pack 1, obtain hotfix 957542 instead. Hotfix 957542 resolves this issue and is available for those operating systems. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

957542 FIX: On a computer that is running the .NET Framework 3.5 Service Pack 1, the JIT compiler and the Native Image Generator (Ngen.exe) that use the Mscorjit.dll file may generate incorrect code

Prerequisites

You must have the .NET Framework 3.5 SP1 installed to apply this hotfix.

Restart requirement

You may have to restart the computer if any of the files that are updated are being used.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
Windows 2000, Windows XP, and Windows Server 2003, x86 versions
File nameFile versionFile sizeDateTime
Mscordacwks.dll2.0.50727.3068992,26416-Sep-200813:13
Mscorlib.dll2.0.50727.30684,546,56016-Sep-200813:13
Mscorwks.dll2.0.50727.30685,815,80816-Sep-200813:13
Windows 2000, Windows XP, and Windows Server 2003, x64 versions
File nameFile versionFile sizeDateTimePlatform
Mscordacwks.dll2.0.50727.3068992,26416-Sep-200813:13x86
Mscorlib.dll2.0.50727.30684,546,56016-Sep-200813:13x86
Mscorwks.dll2.0.50727.30685,815,80816-Sep-200813:13x86
Mscordacwks.dll2.0.50727.30681,767,94416-Sep-200810:33x64
Mscorlib.dll2.0.50727.30684,562,94416-Sep-200810:33x64
Mscorwks.dll2.0.50727.306810,079,74416-Sep-200810:33x64
Windows 2000, Windows XP, and Windows Server 2003, IA-64 versions
File nameFile versionFile sizeDateTimePlatform
Mscordacwks.dll2.0.50727.3068992,26416-Sep-200813:13x86
Mscorlib.dll2.0.50727.30684,546,56016-Sep-200813:13x86
Mscorwks.dll2.0.50727.30685,815,80816-Sep-200813:13x86
Mscordacwks.dll2.0.50727.30683,087,88016-Sep-200810:44IA-64
Mscorlib.dll2.0.50727.30684,005,88816-Sep-200810:44IA-64
Mscorwks.dll2.0.50727.306820,153,85616-Sep-200810:44IA-64

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More Information

Steps to reproduce the problem

To reproduce this problem, create a Microsoft Visual C# project, and then run the following code on a computer that has the .NET Framework 3.5 SP1 installed.
using System;
namespace GetCustomModifiersBug
{
public interface IGenericInterface<T1, T2>
{
void GenericIfcMethod<T3>(T3 t3);
}
class Program
{
static void Main()
{

Type ifc = typeof(IGenericInterface<int, int>);
// Either of the following lines on their own will cause the problem
ifc.GetMethod("GenericIfcMethod").GetParameters()[0].GetOptionalCustomModifiers();
ifc.GetMethod("GenericIfcMethod").GetParameters()[0].GetRequiredCustomModifiers();

}
}
}

↑ Back to the top


References

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

↑ Back to the top


Keywords: kbnotautohotfix, kbhotfixdev, kbexpertiseadvanced, kbfix, kbqfe, kbhotfixserver, kb

↑ Back to the top

Article Info
Article ID : 957541
Revision : 1
Created on : 1/7/2017
Published on : 10/8/2011
Exists online : False
Views : 500