0

我创建了一个 Web 项目,它充当 (ASP).NET Web 应用程序和基于 Web 的 ERP 解决方案之间的链接。其中有四个网站,都使用相同的 .NET Web 应用程序来运行网络商店。我已经成功地将项目应用到一个站点,现在我正在尝试将它应用到其他站点。但是,在第二个站点上设置它时,我不断收到 CS0246 错误。我已将 DLL 文件添加到 BIN 文件夹中,并将名称空间和 Web 引用信息添加到 Web.config 文件中,就像在第一个站点中一样。不过,对于我的生活,我无法弄清楚为什么它会不断导致服务器错误。如果我删除命名空间引用和 DLL 文件,错误就会消失。下面是 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>

我已经为此绞尽脑汁了一段时间,并且希望能对我在这里忽略的内容有任何额外的见解。

4

1 回答 1

0

好的,我知道出了什么问题。基本上,我没有关于远程服务器的完整信息。我成功设置的一个站点正在运行 .NET 4.0,但这些其他站点位于只有 .NET 3.5 的服务器上。由于该项目的目标是 .NET 4.0,我重新定位到 3.5,一切都开始工作了。花了一段时间才终于得到这些信息。

于 2012-10-12T15:14:28.077 回答