none
System.DirectoryServices assembly RRS feed

  • Question

  • Quick question. I am using the following namespaces and assembly below in a .aspx file. It is working fine for me but we have hundreds of users in the field who will be using it also. All local machines are using Windows 7. My question is this: Are those namespaces (and assembly for System.Directoryservices) standard (i.e. out of the box) with Windows 7 and Net Framework? I just want to verify this before I move to production and find out it doesn't work for everyone if it's not standard.

    Thanks.

    <%@ Import Namespace="System"%>
    <%@ Import Namespace="System.Data"%>
    <%@ Import Namespace="System.Data.SqlClient"%>
    <%@ Import Namespace="System.DirectoryServices"%>
    <%@ Assembly Name="System.DirectoryServices, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"%>
    <%@ Page Language="VB" EnableSessionState ="true" %>

    Wednesday, April 30, 2014 1:19 PM

Answers

  • Yes, unfortunately it looks like you need the fully qualified name for the GAC'ed assembly. But you should ensure you're using the version appropriate for your framework. Alternatively (for maintenance reasons) you might consider moving the directive to the web.config so you can change it in one place when you upgrade.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Wednesday, April 30, 2014 5:37 PM
    Moderator

All replies

  • Your code is going to be run on the server side so provided the server has .NET installed (which it would otherwise your app wouldn't run) then you're fine. It does appear that you're using an older version of the framework though given that you are using an explicit version. I'd remove the version info and let it load the latest version from the framework.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Wednesday, April 30, 2014 2:23 PM
    Moderator
  • If I remove the version info leaving just

    <%@ Assembly Name="System.DirectoryServices, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"%>

    I get this error:

    Could not load file or assembly
    'System.DirectoryServices, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
    one of its dependencies. The system cannot find the file specified.

    I am obviously missing something simple here but not sure what it is.

    Wednesday, April 30, 2014 4:21 PM
  • Yes, unfortunately it looks like you need the fully qualified name for the GAC'ed assembly. But you should ensure you're using the version appropriate for your framework. Alternatively (for maintenance reasons) you might consider moving the directive to the web.config so you can change it in one place when you upgrade.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Wednesday, April 30, 2014 5:37 PM
    Moderator