2012-10-03 79 views
0

我創建了一個Web項目,充當(ASP).NET Web應用程序和基於Web的ERP解決方案之間的鏈接。這些網站中有四個都使用相同的.NET Web應用程序來運行網上商店。我已成功將該項目應用於一個站點,現在我正試圖將其應用於其他站點。但是,在第二個站點上進行設置時,我一直收到CS0246錯誤。我已經將DLL文件添加到BIN文件夾中,並且將名稱空間和Web引用信息添加到Web.config文件中,就像在第一個站點中一樣。對於我的生活,我無法弄清楚它爲什麼會導致服務器錯誤,但。如果我刪除名稱空間引用和DLL文件,則錯誤消失。下面是Web.config文件目前的樣子:錯誤CS0246將名稱空間添加到Web.config時

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
     <sectionGroup name="AbleCommerce" type="CommerceBuilder.Configuration.AbleCommerceSettings, CommerceBuilder.Configuration"> 
      <section name="application" type="CommerceBuilder.Configuration.AbleCommerceApplicationSection, CommerceBuilder.Configuration" restartOnExternalChanges="true" requirePermission="false" /> 
      <section name="encryption" type="CommerceBuilder.Configuration.AbleCommerceEncryptionSection, CommerceBuilder.Configuration" restartOnExternalChanges="false" requirePermission="false" /> 
     </sectionGroup> 
     <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 
      <section name="NS_WebServe.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
     </sectionGroup> 
     <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" restartOnExternalChanges="false" requirePermission="false" /> 
     <!-- AJAX --> 
     <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> 
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> 
       <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> 
       <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> 
        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /> 
        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> 
        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> 
       </sectionGroup> 
      </sectionGroup> 
     </sectionGroup> 
     <!-- AJAX --> 
     <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
    </configSections> 
    <AbleCommerce> 
     <application configSource="App_Data\ablecommerce.config" /> 
     <encryption configSource="App_Data\encryption.config" /> 
    </AbleCommerce> 
    <log4net configSource="App_Data\log4net.config" /> 
    <connectionStrings configSource="App_Data\database.config" /> 
    <appSettings> 
     <add key="FCKeditor:UserFilesPath" value="~/Assets" /> 

     <!-- NetSuite Sales Order Addition Login Values --> 
     <add key="login.count" value="" /> 
     <add key="login.email" value="" /> 
     <add key="login.password" value="" /> 
     <add key="login.email2" value="" /> 
     <add key="login.password2" value="" /> 
     <add key="login.email3" value="" /> 
     <add key="login.password3" value="" /> 
     <add key="login.roleId" value="" /> 
     <add key="login.acct" value="" /> 

     <!-- Web Site Information Values --> 
     <add key="site.name" value="" /> 
     <add key="order.prefix" value="" /> 

     <!-- Error E-mail Information --> 
     <add key="error.ccmail.recipcount" value="" /> 
     <add key="error.ccmail.addy1" value="" /> 
     <add key="error.ccmail.name1" value="" /> 
     <add key="error.ccmail.addy2" value="" /> 
     <add key="error.ccmail.name2" value="" /> 

    </appSettings> 
    <system.web> 
     <customErrors mode="On" defaultRedirect="~/Errors/GeneralError.aspx"> 
      <error statusCode="404" redirect="~/Errors/PageNotFound.aspx" /> 
     </customErrors> 
     <pages theme="AbleCommerce" enableEventValidation="false" validateRequest="false"> 
      <controls> 
       <!-- AJAX --> 
       <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
       <add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
       <add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" /> 
       <!-- AJAX --> 
       <add tagPrefix="cb" namespace="CommerceBuilder.Web.UI.WebControls" assembly="CommerceBuilder.Web" /> 
       <add tagPrefix="ComponentArt" namespace="ComponentArt.Web.UI" assembly="ComponentArt.Web.UI" /> 
      </controls> 
      <namespaces> 
       <add namespace="System" /> 
       <add namespace="System.Net" /> 
       <add namespace="System.Web.UI" /> 
       <add namespace="System.Web.UI.WebControls" /> 
       <add namespace="System.Collections.Generic" /> 
       <add namespace="CommerceBuilder.Catalog" /> 
       <add namespace="CommerceBuilder.DigitalDelivery" /> 
       <add namespace="CommerceBuilder.Utility" /> 
       <add namespace="CommerceBuilder.Common" /> 
       <add namespace="CommerceBuilder.Users" /> 
       <add namespace="CommerceBuilder.Products" /> 
       <add namespace="CommerceBuilder.Payments" /> 
       <add namespace="CommerceBuilder.Payments.Providers" /> 
       <add namespace="CommerceBuilder.Stores" /> 
       <add namespace="CommerceBuilder.Messaging" /> 
       <add namespace="CommerceBuilder.Marketing" /> 
       <add namespace="CommerceBuilder.Shipping" /> 
       <add namespace="CommerceBuilder.Taxes" /> 
       <add namespace="CommerceBuilder.Taxes.Providers" /> 
       <add namespace="CommerceBuilder.Orders" /> 
       <add namespace="CommerceBuilder.Reporting" /> 
       <add namespace="CommerceBuilder.Web.UI" /> 
       <add namespace="NS_WebServe" /> <<<<<----- this line here is the troublemaker 
      </namespaces> 
      <tagMapping> 
       <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0" /> 
       <add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0" /> 
       <add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0" /> 
       <add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0" /> 
       <add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0" /> 
       <add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0" /> 
       <add tagType="System.Web.UI.WebControls.WebParts.WebPartZone" mappedTagType="CommerceBuilder.Web.UI.WebControls.WebParts.WebPartZone" /> 
      </tagMapping> 
     </pages> 
     <!-- 
      Set compilation debug="true" to insert debugging 
      symbols into the compiled page. Because this 
      affects performance, set this value to true only 
      during development. 
    --> 
     <trace enabled="false" requestLimit="10" pageOutput="false" localOnly="true" /> 
     <compilation debug="false" strict="false" explicit="false"> 
      <assemblies> 
       <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
       <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
       <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
       <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
       <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
       <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
       <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
       <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      </assemblies> 
     </compilation> 
     <httpHandlers> 
      <!-- AJAX --> 
      <remove verb="*" path="*.asmx" /> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
      <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" /> 
      <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" /> 
      <!-- AJAX --> 
     </httpHandlers> 
     <httpModules> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
      <add name="AbleCommerceHttpModule" type="CommerceBuilder.Services.AbleCommerceHttpModule, CommerceBuilder.Services" /> 
     </httpModules> 
     <authentication mode="Forms"> 
      <forms timeout="90" slidingExpiration="true" name="AC7.ASPXAUTH" /> 
     </authentication> 
     <sessionState mode="InProc" timeout="30" cookieName="AC7.SESSIONID" /> 
     <siteMap defaultProvider="StoreSiteMap"> 
      <providers> 
       <add name="StoreSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap" /> 
       <add name="AdminMenuMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Admin/menu.sitemap" securityTrimmingEnabled="true" /> 
       <add name="AdminBreadCrumbsMap" type="CommerceBuilder.Web.UI.WebControls.DynamicSiteMapProvider" siteMapFile="~/Admin/breadcrumbs.sitemap" securityTrimmingEnabled="false" /> 
      </providers> 
     </siteMap> 
     <roleManager enabled="true" defaultProvider="AbleCommerceRoleProvider"> 
      <providers> 
       <clear /> 
       <add name="AbleCommerceRoleProvider" type="CommerceBuilder.Users.AbleCommerceRoleProvider" connectionStringName="AbleCommerce6" applicationName="/" /> 
      </providers> 
     </roleManager> 
     <membership defaultProvider="AbleCommerceMembershipProvider"> 
      <providers> 
       <clear /> 
       <add name="AbleCommerceMembershipProvider" connectionStringName="AbleCommerce6" applicationName="/" type="CommerceBuilder.Users.AbleCommerceMembershipProvider" /> 
      </providers> 
     </membership> 
     <profile enabled="false" /> 
     <webParts> 
      <personalization defaultProvider="AbleCommercePersonalizationProvider"> 
       <providers> 
        <clear /> 
        <add name="AbleCommercePersonalizationProvider" type="CommerceBuilder.Personalization.PersonalizationProvider" connectionStringName="AbleCommerce6" applicationName="/" /> 
       </providers> 
       <authorization> 
        <allow verbs="enterSharedScope" roles="System,Admin,Jr. Admin,Manage Website" /> 
       </authorization> 
      </personalization> 
     </webParts> 
     <anonymousIdentification enabled="true" cookieName="AC7.ASPXANONYMOUS" cookieTimeout="1440" /> 
     <httpRuntime maxRequestLength="4096" /> 
     <globalization culture="en-US" uiCulture="en-US" /> 
    </system.web> 
    <microsoft.web.services3> 
     <policy fileName="Bin\wse3policyCache.config" /> 
    </microsoft.web.services3> 
    <system.web.extensions> 
     <scripting> 
      <scriptResourceHandler enableCompression="true" enableCaching="true" /> 
     </scripting> 
    </system.web.extensions> 
    <system.webServer> 
     <validation validateIntegratedModeConfiguration="false" /> 
     <modules> 
      <remove name="ScriptModule" /> 
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
      <add name="AbleCommerceHttpModule" type="CommerceBuilder.Services.AbleCommerceHttpModule, CommerceBuilder.Services" preCondition="managedHandler" /> 
     </modules> 
     <handlers> 
      <remove name="WebServiceHandlerFactory-Integrated" /> 
      <remove name="ScriptHandlerFactory" /> 
      <remove name="ScriptHandlerFactoryAppServices" /> 
      <remove name="ScriptResource" /> 
      <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" /> 
      <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" /> 
      <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" /> 
     </handlers> 
    </system.webServer> 
    <system.net> 
     <settings> 
      <httpWebRequest useUnsafeHeaderParsing="true" /> 
     </settings> 
    </system.net> 
    <runtime> 
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
      <dependentAssembly> 
       <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" /> 
       <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" /> 
      </dependentAssembly> 
      <dependentAssembly> 
       <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" /> 
       <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" /> 
      </dependentAssembly> 
     </assemblyBinding> 
    </runtime> 

    <applicationSettings> 
     <NS_WebServe.Properties.Settings> 
      <setting name="NS_WebServe_com_netsuite_webservices_NetSuiteService" 
       serializeAs="String"> 
       <value>https://webservices.netsuite.com/services/NetSuitePort_2011_2</value> 
      </setting> 
     </NS_WebServe.Properties.Settings> 
    </applicationSettings> 

</configuration> 

我一直令人頭大我的大腦在這個有一段時間了,並希望任何額外的洞察力,以我俯瞰這裏。

回答

0

好的,我找出了錯在哪裏。基本上,我沒有完整的遠程服務器信息。我成功設置的一個站點運行的是.NET 4.0,但這些其他站點都在只有.NET 3.5的服務器上。由於該項目的目標是.NET 4.0,我將目標重定向到了3.5,並開始工作。只是花了一段時間才終於獲得這些信息。

相關問題