Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Compiler Error Message: CS0006

Thread Tools

Compiler Error Message: CS0006

Posts: n/a

We suddenly got a mysterious error message on our Windows Server 2003 (SP1)
after rolling out a bug fix on a web services application this morning. The
application compiles and runs fine on the development workstation (from vs
2005 on Windows XP Pro), but when I run "Copy Web Site..." to move the app
out from VS to the server, then all accesses to the web service via a
browser show this error message: "Compiler Error Message: CS0006: Metadata
file" .... "System.EnterpriseServices.dll' could not be found". (Full
error is pasted below.)

I cannot find any references to this error on MS websites or knowledgebase.
I have found several newsgroup references elsewhere stating that you need to
place the DLL into the GAC. But from what I can tell, this
EnterpriseServices DLL is a .NET assembly that is inherently already in the
GAC. (And I looked on the server, and it is present in /windows/assembly.)
Also, several posting say to remove "<identity impersonate="true" />" from
web.config, but we have no such line in ours.

Any recommendations? It's urgent for us.




Server Error in '/ws0200' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: CS0006: Metadata file
'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServi ces\\System.EnterpriseSer vices.dll'
could not be found

Source Error:

[No relevant source lines]

Source File: Line: 0

Show Detailed Compiler Output:

"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc .exe" /t:library
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\ _b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\ b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\ 7a5c561934e089\System.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseSer vices\\System.EnterpriseS ervices.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configurati on\\System.Configuration. dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Service s\\System.Web.Services.dl l"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\ __b77a5c561934e089\System.Xml.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 \Temporary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.d ll" /DEBUG /debug+
/optimize- /w:4 /nowarn:1659;1699
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.1 0.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.3 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.2 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.1 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.0 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.7 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.6 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.9 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.5 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.8 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.4 .cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.1 1.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws0200\ea7bc2bc\ba7084cf\App_Code.kdys5pgv.1 2.cs"

Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42

for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727

Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

error CS0006: Metadata file
'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServi ces\\System.EnterpriseSer vices.dll'
could not be found

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET

Reply With Quote
Steven Cheng[MSFT]
Posts: n/a
Hello Bruce,

Nice to see you again and how are you doing?

Regarding on the error message you mentioned, it seems the ASP.NET runtime
failed to locate the System.EnterpriseServices.dll metadata assembly from
the following loatino:

"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServi ces\

Based on my experience, this is likely a machine specific issue. Have you
tried deploying the web application on other webserver machine to see
whether it also suffers this issue?

I've done some research in our internal database and found some former
cases that have the similar symptom as yours. In those cases, the problem
machine's GAC_32 seems has been corrupted(or not installed well) and the
System.EnterpriseServices.dll assembly is not in the expected location(as

To verify this, you can start the commandline prompt(cmd.exe) on the
problem server machine and navigate to the following directory:

C:\WINDOWS\assembly\GAC_32\System.EnterpriseServic es\

After that use "dir" command to see whether the
System.EnterpriseServices.dll assembly is in it. If the assembly does be
missing, you can manually copy a valid copy into it. You can find a copy of
the "System.EnterpriseServices.dll" in the following location:


After you have copied the assembly, you can test the web application again
to see whether it works.

Hope this helps.


Steven Cheng

Microsoft MSDN Online Support Lead


Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial

response from the community or a Microsoft Support Engineer within 1
business day is

acceptable. Please note that each follow up response may take approximately
2 business days

as the support professional working with you may need further investigation
to reach the

most efficient resolution. The offering is not appropriate for situations
that require

urgent, real-time or phone-based interactions or complex project analysis
and dump analysis

issues. Issues of this nature are best handled working with a dedicated
Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at


This posting is provided "AS IS" with no warranties, and confers no rights.

Reply With Quote
benwhite benwhite is offline
Junior Member
Join Date: Aug 2007
Posts: 1
I had this same issue...

I simply ran the "Microsoft .NET Framework Version 2.0 Redistributable Package" again, and selected the repair option.
Once I rebooted the machine, everything worked again.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CS0006 Compiler Error - but none of the usual causes =?Utf-8?B?Um9iIFdpbGxpYW1z?= ASP .Net 2 12-11-2006 02:32 PM
Compiler error CS0006 =?Utf-8?B?U3RldmVuIEJlcmtvdml0eg==?= ASP .Net 3 06-28-2005 10:49 AM
Compiler Error Message: CS0006 dll cannot be found james margey ASP .Net 4 11-29-2004 02:13 AM
Strange compiler behavior after CS0006 error Kris Vanherck ASP .Net 2 04-21-2004 02:34 PM
Compiler Error Message: CS0006 Invalidlastname ASP .Net 1 11-07-2003 06:49 AM