The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

Could not load file or assembly System.EnterpriseServices compile error in ASP.NET
I have been receiving this error recently with a web site I was developing. Its rather weird because I am not using it nor had I any reference to System.EnterpriseServices or anything else that might have. In fact the web site was new so didn’t have much of a reference to anything except the default assemblies. Well a little searching turned up that the there was a reference to the System.EnterpriseServices assembly in the web.config located in the "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG" folder.
 
How it got there? I can only assume it’s the result of recently installing the Microsoft Enterprise Library. Now that was about a weeks ago but its quite possible that I didn’t do any other ASP.NET development since. Whatever the cause was, if you receive the same error that is one thing you might want to check.
 
Enjoy!
Maurice de Beijer
 
Published Wed, Oct 11 2006 19:17 by Maurice
Filed under:

Comments

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Friday, December 08, 2006 8:07 AM

add System.EnterpriseServices into your reference will solve your problem as it solved mine :)

by luck

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Friday, December 08, 2006 12:35 PM

Yes that works. However I don't really want to add a reference to an assembly I have no intentions of using to a project and start distributing it with my solution to customers.

by Maurice

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Friday, November 23, 2007 3:20 PM

Adding a reference to System.EnterpriseServices only fixes the compile problem.  You will still get a run-time issue as this answer does not correct the root problem.  I'm still looking for a solution.

by Al

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Friday, November 23, 2007 3:53 PM

Thank you so much Maurice for this post.  As you suggested, I removed the entry from web.config in the CONFIG folder.  I also removed it from web.config.comments (I believe that is the file name).  I finally removed the entry from my project's web.config.  This finally resolved my issue with this project and when creating new projects.

by Al

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Monday, March 03, 2008 3:12 AM

Thanks a lot . As you suggested, I removed the entry from web.config in the CONFIG folder. It works fine.

by John

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Thursday, April 17, 2008 12:21 PM

Hi!

Other solution: drag the System.DirectoryServices assembly from your current .net framework directory to the GAC.

It worked for me, but I still don't know why this problem came up...

by guci

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Friday, August 08, 2008 5:22 AM

Neither of these solutions worked.

Fixed the problem by repairing visual studio via Add/Remove programs in control panel.

...bloody microsoft

by Luke

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Wednesday, October 01, 2008 9:23 AM

Dragging the System.DirectoryServices.dll from the .NET directory to the GAC worked for me.

thanks guci

by angrytony

# re: Could not load file or assembly System.EnterpriseServices compile error in ASP.NET@ Wednesday, February 04, 2009 10:05 AM

Thanks for this fix. Sorted my problem out.

by Phil

# cheap propecia buy online@ Saturday, May 30, 2009 3:40 PM

Excellent site, It was pleasant to me.