从索引 0 处开始,初始化字符串的格式不符合规范。

时间:2022-09-30 03:00:11
web.config如下
<?xml version="1.0"?>
<configuration>

  <configSections>
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data"/>
  </configSections>

  <dataConfiguration defaultDatabase="HidistroSqlServer"/>

  <connectionStrings>
    <add name="HidistroSqlServer" connectionString="required" providerName="System.Data.SqlClient"/>
  </connectionStrings>

  <appSettings>
    <add key="Kindeditor:BasePath" value="~/kindeditor/"/>
    <add key="Kindeditor:FileCategoryJson" value="~/Admin/FileCategoryJson.aspx"/>
    <add key="Kindeditor:FileManagerJson" value="~/Admin/FileManagerJson.aspx"/>
    <add key="Kindeditor:UploadFileJson" value="~/Admin/UploadFileJson.aspx"/>
    <add key="Installer" value="false"/>
  </appSettings>
  
  <system.web>
    <!--<sessionState mode="Off" />-->
    <machineKey validationKey="12161FAA135CA1FEAECE734E53410A98B8318C0F"
   decryptionKey="39474EC70DE38C24FE0B03F689A94AF19DC5188E0B42B797"
   validation="SHA1" decryption="3DES" />
    <pages buffer="true" enableViewStateMac="false" enableEventValidation="false" viewStateEncryptionMode="Never" enableSessionState="false"  validateRequest="false" autoEventWireup="false" pageBaseType="Hidistro.UI.Common.Controls.HiPage, Hidistro.UI.Common.Controls" />
    <trace enabled="false" pageOutput="false"/>
    <customErrors mode="Off" />
    <compilation debug="false" />
       
    <httpHandlers>
      <add verb="*" path="SubmmitOrderHandler.aspx" type="Hidistro.UI.SaleSystem.CodeBehind.SubmmitOrderHandler, Hidistro.UI.SaleSystem.CodeBehind"/>
      <add verb="*" path="ShoppingHandler.aspx" type="Hidistro.UI.SaleSystem.CodeBehind.ShoppingHandler, Hidistro.UI.SaleSystem.CodeBehind"/>
      <add verb="*" path="RegionHandler.aspx" type="Hidistro.UI.Common.Controls.RegionHandler, Hidistro.UI.Common.Controls"/>
      <add verb="*" path="UserStatisticeChart.aspx" type="Hidistro.UI.Common.Controls.UserStatisticeChart, Hidistro.UI.Common.Controls"/>
      <add verb="*" type="Hidistro.UI.Common.Controls.UploadHandler,Hidistro.UI.Common.Controls" path="uploadHandler.aspx" />
      <add verb="*" path="PluginHandler.aspx" type="Hishop.Plugins.ConfigHandler, Hishop.Plugins"/>
<add verb="*" path="ExpressData.aspx" type="Hidistro.UI.SaleSystem.CodeBehind.ExpressData, Hidistro.UI.SaleSystem.CodeBehind"/>
    </httpHandlers>

    <httpModules>
      <add name="Hidistro" type="Hidistro.Membership.Context.HiHttpModule, Hidistro.Membership.Context"/>
    </httpModules>

    <membership userIsOnlineTimeWindow="15" defaultProvider="SQLMembershipProvider">
      <providers>
        <add name="SQLMembershipProvider" type="Hidistro.Membership.ASPNETProvider.SqlMembershipProvider, Hidistro.Membership.ASPNETProvider" connectionStringName="HidistroSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" applicationName="Hidistro" maxInvalidPasswordAttempts="5" passwordAttemptWindow="999" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"/>
      </providers>
    </membership>

    <roleManager defaultProvider="SQLRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".HishopRoles" cookieTimeout="90" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" createPersistentCookie="true" cookieProtection="All" maxCachedResults="1000">
      <providers>
        <add name="SQLRoleProvider" type="Hidistro.Membership.ASPNETProvider.SqlRoleProvider, Hidistro.Membership.ASPNETProvider" connectionStringName="HidistroSqlServer" applicationName="Hidistro"/>
      </providers>
    </roleManager>

    <anonymousIdentification enabled="false"/>

    <authentication mode="Forms">
      <forms name=".Hidistro" protection="All" timeout="240" loginUrl="loginEntry.aspx" cookieless="UseCookies" slidingExpiration="true"/>
    </authentication>

    <webServices>
      <protocols>
        <remove name="HttpPost"/>
        <remove name="HttpGet"/>
        <remove name="HttpPostLocalhost"/>
        <remove name="Documentation"/>
        <remove name="Unknown"/>
      </protocols>
      <soapExtensionImporterTypes>
        <add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </soapExtensionImporterTypes>
      <soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </webServices>

  </system.web>
  
  <microsoft.web.services3>
    <security>
      <securityTokenManager>
        <add type="Hidistro.UI.Web.HiUsernameTokenManager,Hidistro.UI.Web" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken"/>
      </securityTokenManager>
      <timeToleranceInSeconds value="3600" />
    </security>
    <policy fileName="wse3policyCache.config"/>
  </microsoft.web.services3>
<system.net>
<defaultProxy>
<proxy usesystemdefault="false" />
</defaultProxy>
</system.net>
</configuration>

7 个解决方案

#1


你把问题描述清楚,谢谢

#2


该回复于2012-06-28 12:58:12被版主删除

#3


打开网页出现这个
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

从索引 0 处开始,初始化字符串的格式不符合规范。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  

堆栈跟踪: 


[ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。]
   System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +4865486
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +129
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
   Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateConnection() +33
   Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection() +137
   Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection(Boolean disposeInnerConnection) +74
   Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command) +41
   Hidistro.Membership.Data.SettingsData.GetDistributorSettings(String siteUrl) +160
   Hidistro.Membership.Context.SettingsManager.GetSiteSettings() +174
   Hidistro.Membership.Context.HiContext.get_SiteSettings() +70
   Hidistro.Membership.Context.HiHttpModule.Application_BeginRequest(Object source, EventArgs e) +859
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 


--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3634; ASP.NET 版本:2.0.50727.3634 

#4


我也遇到这个问题了!

#5


conncection string个是错误了

 <add name="HidistroSqlServer"  connectionString="required" providerName="System.Data.SqlClient"/>

正常的应该是这样的吧

<connectionStrings>
<add name="myConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />
</connectionStrings>

#6


截了这么多为什么不说明问题 从索引 0 处开始,初始化字符串的格式不符合规范。

#7


要学会找重点啊

#1


你把问题描述清楚,谢谢

#2


该回复于2012-06-28 12:58:12被版主删除

#3


打开网页出现这个
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

从索引 0 处开始,初始化字符串的格式不符合规范。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  

堆栈跟踪: 


[ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。]
   System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +4865486
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +129
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
   Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateConnection() +33
   Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection() +137
   Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection(Boolean disposeInnerConnection) +74
   Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command) +41
   Hidistro.Membership.Data.SettingsData.GetDistributorSettings(String siteUrl) +160
   Hidistro.Membership.Context.SettingsManager.GetSiteSettings() +174
   Hidistro.Membership.Context.HiContext.get_SiteSettings() +70
   Hidistro.Membership.Context.HiHttpModule.Application_BeginRequest(Object source, EventArgs e) +859
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 


--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3634; ASP.NET 版本:2.0.50727.3634 

#4


我也遇到这个问题了!

#5


conncection string个是错误了

 <add name="HidistroSqlServer"  connectionString="required" providerName="System.Data.SqlClient"/>

正常的应该是这样的吧

<connectionStrings>
<add name="myConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />
</connectionStrings>

#6


截了这么多为什么不说明问题 从索引 0 处开始,初始化字符串的格式不符合规范。

#7


要学会找重点啊