When I deploy my project to my production server, the namespace System.DirectoryServices isn't found

319 Views Asked by At

I am very new to .NET. I have a web project in 4.0, Visual Studio 2010, using C#. I have added a reference in my project for System.DirectoryServices, and then used it in my code page. No build errors locally. I also have the property Copy Local set to "true" (I did this just to get the reference recognized locally...perhaps this is an issue as well).

When I deploy the project to my production server, the namespace isn't found, though on my staging share I do see the DLL in the bin folder. I get this error:

Compiler Error Message: CS0234: The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)

I am wondering what setting or configuration I am missing to get this reference to be visible to my production server. Let me know if more information is needed. Thanks!

1

There are 1 best solutions below

0
SeanFlynn On BEST ANSWER

I added the assembly in my web.config file, and the page now works.

<compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.DirectoryServices, Version=4.0.0.0,Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            </assemblies>
</compilation>