title: Error CS0246 When Adding Namespace to Web.config
body: <p>I have created a web project that acts as a link between a (ASP).NET web application and a web-based ERP solution. There are four of these web sites, all using the same .NET web application to run the web store. I have successfully applied the project to one site and now I'm trying to apply it to the others. However, when setting it up on the second site, I keep getting the CS0246 error. I have added the DLL file to the BIN folder and I added the namespace and web reference information to the Web.config file, just like in the first site. For the life of me I can't figure out why it keeps causing a server error, though. If I remove the namespace reference and the DLL file the error goes away. Here is what the Web.config file currently looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
      &lt;configSections&gt;
          &lt;sectionGroup name="AbleCommerce" type="CommerceBuilder.Configuration.AbleCommerceSettings, CommerceBuilder.Configuration"&gt;
              &lt;section name="application" type="CommerceBuilder.Configuration.AbleCommerceApplicationSection, CommerceBuilder.Configuration" restartOnExternalChanges="true" requirePermission="false" /&gt;
              &lt;section name="encryption" type="CommerceBuilder.Configuration.AbleCommerceEncryptionSection, CommerceBuilder.Configuration" restartOnExternalChanges="false" requirePermission="false" /&gt;
          &lt;/sectionGroup&gt;
          &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" &gt;
              &lt;section name="NS_WebServe.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
          &lt;/sectionGroup&gt;
          &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" restartOnExternalChanges="false" requirePermission="false" /&gt;
          &lt;!-- AJAX --&gt;
          &lt;sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
              &lt;sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
                  &lt;section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                  &lt;sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
                      &lt;section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /&gt;
                      &lt;section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                      &lt;section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                  &lt;/sectionGroup&gt;
              &lt;/sectionGroup&gt;
          &lt;/sectionGroup&gt;
          &lt;!-- AJAX --&gt;
          &lt;section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
      &lt;/configSections&gt;
      &lt;AbleCommerce&gt;
          &lt;application configSource="App_Data\ablecommerce.config" /&gt;
          &lt;encryption configSource="App_Data\encryption.config" /&gt;
      &lt;/AbleCommerce&gt;
      &lt;log4net configSource="App_Data\log4net.config" /&gt;
      &lt;connectionStrings configSource="App_Data\database.config" /&gt;
      &lt;appSettings&gt;
          &lt;add key="FCKeditor:UserFilesPath" value="~/Assets" /&gt;
  
          &lt;!-- NetSuite Sales Order Addition Login Values --&gt;
          &lt;add key="login.count" value="" /&gt;
          &lt;add key="login.email" value="" /&gt;
          &lt;add key="login.password" value="" /&gt;
          &lt;add key="login.email2" value="" /&gt;
          &lt;add key="login.password2" value="" /&gt;
          &lt;add key="login.email3" value="" /&gt;
          &lt;add key="login.password3" value="" /&gt;
          &lt;add key="login.roleId" value="" /&gt;
          &lt;add key="login.acct" value="" /&gt;
  
          &lt;!-- Web Site Information Values --&gt;
          &lt;add key="site.name" value="" /&gt;
          &lt;add key="order.prefix" value="" /&gt;
  
          &lt;!-- Error E-mail Information --&gt;
          &lt;add key="error.ccmail.recipcount" value="" /&gt;
          &lt;add key="error.ccmail.addy1" value="" /&gt;
          &lt;add key="error.ccmail.name1" value="" /&gt;
          &lt;add key="error.ccmail.addy2" value="" /&gt;
          &lt;add key="error.ccmail.name2" value="" /&gt;
  
      &lt;/appSettings&gt;
      &lt;system.web&gt;
          &lt;customErrors mode="On" defaultRedirect="~/Errors/GeneralError.aspx"&gt;
              &lt;error statusCode="404" redirect="~/Errors/PageNotFound.aspx" /&gt;
          &lt;/customErrors&gt;
          &lt;pages theme="AbleCommerce" enableEventValidation="false" validateRequest="false"&gt;
              &lt;controls&gt;
                  &lt;!-- AJAX --&gt;
                  &lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
                  &lt;add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
                  &lt;add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" /&gt;
                  &lt;!-- AJAX --&gt;
                  &lt;add tagPrefix="cb" namespace="CommerceBuilder.Web.UI.WebControls" assembly="CommerceBuilder.Web" /&gt;
                  &lt;add tagPrefix="ComponentArt" namespace="ComponentArt.Web.UI" assembly="ComponentArt.Web.UI" /&gt;
              &lt;/controls&gt;
              &lt;namespaces&gt;
                  &lt;add namespace="System" /&gt;
                  &lt;add namespace="System.Net" /&gt;
                  &lt;add namespace="System.Web.UI" /&gt;
                  &lt;add namespace="System.Web.UI.WebControls" /&gt;
                  &lt;add namespace="System.Collections.Generic" /&gt;
                  &lt;add namespace="CommerceBuilder.Catalog" /&gt;
                  &lt;add namespace="CommerceBuilder.DigitalDelivery" /&gt;
                  &lt;add namespace="CommerceBuilder.Utility" /&gt;
                  &lt;add namespace="CommerceBuilder.Common" /&gt;
                  &lt;add namespace="CommerceBuilder.Users" /&gt;
                  &lt;add namespace="CommerceBuilder.Products" /&gt;
                  &lt;add namespace="CommerceBuilder.Payments" /&gt;
                  &lt;add namespace="CommerceBuilder.Payments.Providers" /&gt;
                  &lt;add namespace="CommerceBuilder.Stores" /&gt;
                  &lt;add namespace="CommerceBuilder.Messaging" /&gt;
                  &lt;add namespace="CommerceBuilder.Marketing" /&gt;
                  &lt;add namespace="CommerceBuilder.Shipping" /&gt;
                  &lt;add namespace="CommerceBuilder.Taxes" /&gt;
                  &lt;add namespace="CommerceBuilder.Taxes.Providers" /&gt;
                  &lt;add namespace="CommerceBuilder.Orders" /&gt;
                  &lt;add namespace="CommerceBuilder.Reporting" /&gt;
                  &lt;add namespace="CommerceBuilder.Web.UI" /&gt;
                  &lt;add namespace="NS_WebServe" /&gt;  &lt;&lt;&lt;&lt;&lt;----- this line here is the troublemaker
              &lt;/namespaces&gt;
              &lt;tagMapping&gt;
                  &lt;add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0" /&gt;
                  &lt;add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0" /&gt;
                  &lt;add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0" /&gt;
                  &lt;add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0" /&gt;
                  &lt;add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0" /&gt;
                  &lt;add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0" /&gt;
                  &lt;add tagType="System.Web.UI.WebControls.WebParts.WebPartZone" mappedTagType="CommerceBuilder.Web.UI.WebControls.WebParts.WebPartZone" /&gt;
              &lt;/tagMapping&gt;
          &lt;/pages&gt;
          &lt;!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
      --&gt;
          &lt;trace enabled="false" requestLimit="10" pageOutput="false" localOnly="true" /&gt;
          &lt;compilation debug="false" strict="false" explicit="false"&gt;
              &lt;assemblies&gt;
                  &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
                  &lt;add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /&gt;
                  &lt;add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
                  &lt;add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
                  &lt;add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /&gt;
                  &lt;add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
                  &lt;add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /&gt;
                  &lt;add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
              &lt;/assemblies&gt;
          &lt;/compilation&gt;
          &lt;httpHandlers&gt;
              &lt;!-- AJAX --&gt;
              &lt;remove verb="*" path="*.asmx" /&gt;
              &lt;add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
              &lt;add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
              &lt;add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" /&gt;
              &lt;!-- AJAX --&gt;
          &lt;/httpHandlers&gt;
          &lt;httpModules&gt;
              &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
              &lt;add name="AbleCommerceHttpModule" type="CommerceBuilder.Services.AbleCommerceHttpModule, CommerceBuilder.Services" /&gt;
          &lt;/httpModules&gt;
          &lt;authentication mode="Forms"&gt;
              &lt;forms timeout="90" slidingExpiration="true" name="AC7.ASPXAUTH" /&gt;
          &lt;/authentication&gt;
          &lt;sessionState mode="InProc" timeout="30" cookieName="AC7.SESSIONID" /&gt;
          &lt;siteMap defaultProvider="StoreSiteMap"&gt;
              &lt;providers&gt;
                  &lt;add name="StoreSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap" /&gt;
                  &lt;add name="AdminMenuMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Admin/menu.sitemap" securityTrimmingEnabled="true" /&gt;
                  &lt;add name="AdminBreadCrumbsMap" type="CommerceBuilder.Web.UI.WebControls.DynamicSiteMapProvider" siteMapFile="~/Admin/breadcrumbs.sitemap" securityTrimmingEnabled="false" /&gt;
              &lt;/providers&gt;
          &lt;/siteMap&gt;
          &lt;roleManager enabled="true" defaultProvider="AbleCommerceRoleProvider"&gt;
              &lt;providers&gt;
                  &lt;clear /&gt;
                  &lt;add name="AbleCommerceRoleProvider" type="CommerceBuilder.Users.AbleCommerceRoleProvider" connectionStringName="AbleCommerce6" applicationName="/" /&gt;
              &lt;/providers&gt;
          &lt;/roleManager&gt;
          &lt;membership defaultProvider="AbleCommerceMembershipProvider"&gt;
              &lt;providers&gt;
                  &lt;clear /&gt;
                  &lt;add name="AbleCommerceMembershipProvider" connectionStringName="AbleCommerce6" applicationName="/" type="CommerceBuilder.Users.AbleCommerceMembershipProvider" /&gt;
              &lt;/providers&gt;
          &lt;/membership&gt;
          &lt;profile enabled="false" /&gt;
          &lt;webParts&gt;
              &lt;personalization defaultProvider="AbleCommercePersonalizationProvider"&gt;
                  &lt;providers&gt;
                      &lt;clear /&gt;
                      &lt;add name="AbleCommercePersonalizationProvider" type="CommerceBuilder.Personalization.PersonalizationProvider" connectionStringName="AbleCommerce6" applicationName="/" /&gt;
                  &lt;/providers&gt;
                  &lt;authorization&gt;
                      &lt;allow verbs="enterSharedScope" roles="System,Admin,Jr. Admin,Manage Website" /&gt;
                  &lt;/authorization&gt;
              &lt;/personalization&gt;
          &lt;/webParts&gt;
          &lt;anonymousIdentification enabled="true" cookieName="AC7.ASPXANONYMOUS" cookieTimeout="1440" /&gt;
          &lt;httpRuntime maxRequestLength="4096" /&gt;
          &lt;globalization culture="en-US" uiCulture="en-US" /&gt;
      &lt;/system.web&gt;
      &lt;microsoft.web.services3&gt;
          &lt;policy fileName="Bin\wse3policyCache.config" /&gt;
      &lt;/microsoft.web.services3&gt;
      &lt;system.web.extensions&gt;
          &lt;scripting&gt;
              &lt;scriptResourceHandler enableCompression="true" enableCaching="true" /&gt;
          &lt;/scripting&gt;
      &lt;/system.web.extensions&gt;
      &lt;system.webServer&gt;
          &lt;validation validateIntegratedModeConfiguration="false" /&gt;
          &lt;modules&gt;
              &lt;remove name="ScriptModule" /&gt;
              &lt;add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
              &lt;add name="AbleCommerceHttpModule" type="CommerceBuilder.Services.AbleCommerceHttpModule, CommerceBuilder.Services" preCondition="managedHandler" /&gt;
          &lt;/modules&gt;
          &lt;handlers&gt;
              &lt;remove name="WebServiceHandlerFactory-Integrated" /&gt;
              &lt;remove name="ScriptHandlerFactory" /&gt;
              &lt;remove name="ScriptHandlerFactoryAppServices" /&gt;
              &lt;remove name="ScriptResource" /&gt;
              &lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
              &lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
              &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
          &lt;/handlers&gt;
      &lt;/system.webServer&gt;
      &lt;system.net&gt;
          &lt;settings&gt;
              &lt;httpWebRequest useUnsafeHeaderParsing="true" /&gt;
          &lt;/settings&gt;
      &lt;/system.net&gt;
      &lt;runtime&gt;
          &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
              &lt;dependentAssembly&gt;
                  &lt;assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" /&gt;
                  &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" /&gt;
              &lt;/dependentAssembly&gt;
              &lt;dependentAssembly&gt;
                  &lt;assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" /&gt;
                  &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" /&gt;
              &lt;/dependentAssembly&gt;
          &lt;/assemblyBinding&gt;
      &lt;/runtime&gt;
  
      &lt;applicationSettings&gt;
          &lt;NS_WebServe.Properties.Settings&gt;
              &lt;setting name="NS_WebServe_com_netsuite_webservices_NetSuiteService"
                serializeAs="String"&gt;
                  &lt;value&gt;https://webservices.netsuite.com/services/NetSuitePort_2011_2&lt;/value&gt;
              &lt;/setting&gt;
          &lt;/NS_WebServe.Properties.Settings&gt;
      &lt;/applicationSettings&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I've been wracking my brain over this for a while now and would appreciate any additional insight as to what I'm overlooking here.</p>