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: You receive an access violation when you open a Visual C# project in Visual Studio 2010 and an enum and a class have the same fully qualified name


View products that this article applies to.

Symptoms

Consider the following scenario:
  • You have a Visual C# project in Microsoft Visual Studio 2010.
  • You define an enumeration (enum) and a class that have the same name in the same project namespace so that these two types have the same fully qualified name. 
  • The class contains a static constructor.
  • You open the project by using the IDE.

In this scenario, an Access Violation occurs and the IDE crashes. Additionally, an error message that resembles the following is logged in the Application log:

Problem Event Name:
Application Name: devenv.exe
Fault Module Name: cslangsvc.dll
Exception code: c0000005

↑ Back to the top


Cause

This problem occurs because the IDE forces the compiler to bind a static constructor.

↑ Back to the top


Resolution

To resolve this problem, apply this hotfix.

After you apply the hotfix, the Visual Studio IDE does not crash. Instead, you receive the following error message:
The namespace “namespace_name” already contains a definition for “class_name”.

More information about this hotfix

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.


Prerequisites

You must have Microsoft Visual Studio 2010 installed to apply this hotfix.

Restart information

You do not have to restart the computer after you apply this hotfix.

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.

File nameFile versionFile sizeDateTimePlatform
Cslangsvc.dll10.0.30319.3465,769,55206-Aug-201005:42x86

↑ 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


Keywords: kbqfe, kbhotfixserver, kbfix, kbsurveynew, kbprb, kbexpertiseinter, kbnotautohotfix, kb

↑ Back to the top

Article Info
Article ID : 2266012
Revision : 2
Created on : 9/25/2018
Published on : 9/25/2018
Exists online : False
Views : 265