none
Could not load file or assembly "System.EnterpriseServices... RRS feed

  • Question

  • I have a C++/CLI library which is consumed by applications. I am getting the following error:

    Could not load file or assembly "System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" or one of its dependencies. The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)

    The code is trying to connect to a SQL Server 2005 database. The error does not always happen. It happens for some domain users and not others. It also seems to depend on local Administrators group membership of the user trying to use the code itself.

    Please help me to unerstand how I can avoid this error. Why does it happen for some and not all users?

    Monday, July 6, 2009 7:14 PM

Answers

  • I found that running the following from the visual studio 2005 tools command prompt and then logging out and back in again fixes the problem. I assume that the .Net security settings have gotten corrupt.

     

    caspol.exe -all -reset

     

    • Marked as answer by TAAdams Tuesday, July 14, 2009 6:30 PM
    Tuesday, July 14, 2009 6:30 PM

All replies

  • Hi,

    Could you provide more detailed information? Like "some users", are there any similarities among these users' configuration but not with the others?

    What is the OS version/SP? And OS architecture (x86? x64?)

    What is the .NET Framework version installed, 2.0? 3.0? 3.5? And service pack?

    What is the full call stack of this exception?

    You can also try:

    Remove System.EnterpriseServices from the GAC (both x86 and AMD64): Start the Windows Explorer as administrator, navigate to \Windows\Assembly, uninstall System.EnterpriseServices.

    Add them back to GAC again: drag & drop System.EnterpriseServices.dll from \Windows\Microsoft.NET\Framework\v2.0.50727\ to \Windows\Assembly

    The steps above can also be done with the gacutil tool within a admin command prompt.

    Also you can try repair the .NET Framework installation (in Vista the .NET 2.0 & 3.0 can't be directly uninstalled/repaired).

    Looking forward to more info.

    Thanks,

    Jie
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

    The CodeFx Project
    My Blog (in Simplified Chinese)
    Tuesday, July 7, 2009 8:39 AM
    Moderator
  • I can not verify if the systems where the issue is happening on are all identical. The latest one that I looked at was an x86 2003 R2 SP2. It had .Net 1, 1.1, 2 sp2, 3 sp3, 3.5 sp1.

    I have tried repairing .Net 2 and it has failed on the same assembly where I am having issues.

    How can I determine what the dependancies for System.EnterpriseServices are? I'll verify that they are in place. I'm still trying to get the differences between the user accounts. They are both an local administrator group. I'm still trying to guage the differences between the working and non working accounts.
    Tuesday, July 7, 2009 4:06 PM
  • On further inspection I see several things:

    c:\windows\assembly is entirely empty when I view it using explorer.

    If I try to use the .Net 2 configuration utility to add the assembly to the cache (it shows the cache as being populated however missing the System.EnterpriseServices.dll) it says it is unable to add the file to the cache because it does not have a strong name.

    This brings up yet more questions:

    How are others able to use it? Are there environment variables that tell the runtime where to look for the System.EnterpriseServices.dll besides the gac? If so what are they and are they on a machine or per user basis?

    Can (should) I make the dll strong named so that it can be added to the cache? If so how can I do this?
    Tuesday, July 7, 2009 9:06 PM
  • .NET installs an extension to the Explorer so the view in C:\Windows\Assembly is handled differently. When you see it is empty from the explorer, could be problem of the extension. How about using a command prompt and CD C:\Windows\Assembly then DIR? Anything there?

    The System.EnterpriseServices.dll is StrongName signed by Microsoft, 3rd party can't sign it. If the tool says it is not signed, then the file is damaged.

    Also, the System.EnterpriseServices.dll must live in GAC and be registered correctly during the setup.

    Another thing to try is uninstall the .NET Framework (2.0 - 3.5) and then use the .NET Cleanup tool to ensure the removal of .NET Framework on that machine. After that, re-install .NET Framework and see if it works.

    Thanks,

    Jie
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

    The CodeFx Project
    My Blog (in Simplified Chinese)
    Thursday, July 9, 2009 12:44 PM
    Moderator
  • I am unable to get into the one system that I know this is an issue with this morning.

    I know that I have seen this on multiple production systems and I don't now that rebuilding the .Net environment is an option for me. What I don't understand is why it works for one active directory domain user and not another. I've seen it work for one user and not another on the same system.

    I need to understand what makes it work for the one user and not the other. Are there enviromnent variables that determine the path that is searched for the dll including the gac? If so what are they?
    Thursday, July 9, 2009 4:25 PM
  • Are there enviromnent variables that determine the path that is searched for the dll including the gac? If so what are they?

    Hope this article helps you understand how .NET locates assemblies:
    How the Runtime Locates Assemblies

    You can try copy the assembly into your application folder but I don't think that would make any changes and that's not a clean solution without finding out the root cause.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

    The CodeFx Project
    My Blog (in Simplified Chinese)
    Monday, July 13, 2009 8:18 AM
    Moderator
  • I found that running the following from the visual studio 2005 tools command prompt and then logging out and back in again fixes the problem. I assume that the .Net security settings have gotten corrupt.

     

    caspol.exe -all -reset

     

    • Marked as answer by TAAdams Tuesday, July 14, 2009 6:30 PM
    Tuesday, July 14, 2009 6:30 PM
  • IDK if you got this fixed!  I ran into the problem, discovered why, and provide a fix.  Gotta love the internet and it's vast information.

     

    http://phxthunder.blogspot.com/2010/03/systementerpriseservices-exception-when.html

     

    Peace Out!

    -PHXThunder

    Wednesday, March 31, 2010 5:19 PM
  • Just delete  this dll file the published folder.

    It works for me.

    Tuesday, April 24, 2012 6:21 AM