未能映射路径“/”MySQL
我正在尝试使用web.config连接到MySQL,并使用MySQL网站配置。问题是它会使我的站点在运行时显示错误,而不是在运行时显示错误:D 这是我的web.config SQL连接:未能映射路径“/”MySQL,mysql,asp.net,Mysql,Asp.net,我正在尝试使用web.config连接到MySQL,并使用MySQL网站配置。问题是它会使我的站点在运行时显示错误,而不是在运行时显示错误:D 这是我的web.config SQL连接: <connectionStrings> <remove name="LocalMySqlServer" /> <add name="LocalMySqlServer" connectionString="password=PASS****;user id=9b443
<connectionStrings>
<remove name="LocalMySqlServer" />
<add name="LocalMySqlServer" connectionString="password=PASS****;user id=9b443f_users;server=MYSQL5008.myWindowsHosting.com;database=db_9b443f_users" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<system.web>
<sessionState mode="Custom" cookieless="true" regenerateExpiredSessionId="true" customProvider="MySqlSessionStateProvider">
<providers>
<add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="Sessions" description="Sessions" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True" enableExpireCallback="False" />
</providers>
</sessionState>
<profile defaultProvider="MySQLProfileProvider">
<providers>
<remove name="MySQLProfileProvider" />
<add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="Profiles" description="Profiles" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True" enableExpireCallback="False" />
</providers>
</profile>
<membership defaultProvider="MySQLMembershipProvider">
<providers>
<remove name="MySQLMembershipProvider" />
<add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="MemRecords" description="MySQL default application" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True" enableExpireCallback="False" enablePasswordRetrieval="False" enablePasswordReset="True" requiresQuestionAndAnswer="True" requiresUniqueEmail="True" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="MySQLRoleProvider">
<providers>
<remove name="MySQLRoleProvider" />
<add name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="Roles" description="Roles" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="False" autogenerateschema="True" enableExpireCallback="False" />
</providers>
</roleManager>
<compilation debug="true" targetFramework="4.0" />
<identity impersonate="false" />
<authentication mode="Forms">
<forms loginUrl="default.aspx" />
</authentication>
</system.web>
这是它显示给我的堆栈跟踪:
[InvalidOperationException:未能映射路径“/”。]
System.Web.Configuration.ProcessHostConfigUtils.MapPathActualString
站点名称,虚拟路径+224
System.Web.Configuration.ProcessHostMapPath.MapPathCachingString
站点ID,虚拟路径+865
System.Web.Configuration.ProcessHostMapPath.GetPathConfigFilenameWorkerString
siteID、VirtualPath路径、字符串和目录、字符串和baseName+13
System.Web.Configuration.ProcessHostMapPath.System.Web.Configuration.IConfigMapPath.GetPathConfigFilenameString
siteID、字符串路径、字符串和目录、字符串和基本名称+37
System.Web.Configuration.HostingPreferredMapPath.GetPathConfigFilenameString
siteID、字符串路径、字符串和目录、字符串和基本名称+75
System.Web.Configuration.WebConfigurationHost.GetStreamNameString
配置路径+9844796
System.Configuration.Internal.DelegatingConfigHost.GetStreamNameString
配置路径+11
System.Configuration.BaseConfigurationRecord.InitConfigFromFile+134
[ConfigurationErrorsException:加载时出错
配置文件:未能映射路径“/”。]
System.Configuration.ConfigurationSchemaErrors.ThrowIfErrorsBoolean
ignoreLocal+658656
System.Configuration.BaseConfigurationRecord.ThrowifParseErrors配置方案错误
schemaErrors+34系统.配置.配置..字符串
locationSubPath,类型为typeConfigHost,对象[]
hostInitConfigurationParams+328
System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IIInternalConfigurationFactory.CreateType
typeConfigHost,对象[]hostInitConfigurationParams+29
System.Web.Configuration.WebConfigurationHost.OpenConfigurationWebLevel
webLevel、ConfigurationFileMap文件映射、虚拟路径、字符串站点、,
字符串位置子路径,字符串服务器,字符串用户名,字符串
密码,IntPtr令牌句柄+387
System.Web.Configuration.WebConfiguration Manager.OpenWebConfiguration字符串
路径+76
MySql.Web.SessionState.MySqlSessionStateStore.InitializeString名称,
NameValueCollection配置+437
System.Web.Configuration.ProvidersHelper.InstanceProviderProviderSettings
providerSettings,输入providerType+597
System.Web.SessionState.SessionStateModule.SecureInstanceProviderProviderSettings
设置+43
System.Web.SessionState.SessionStateModule.InitCustomStoreSessionStateSection
配置+87
System.Web.SessionState.SessionStateModule.InitModuleFromConfigHttpApplication
应用程序,会话状态部分配置+9777245
System.Web.SessionState.SessionStateModule.InitHttpApplication应用程序
+159 System.Web.HttpApplication.InitModulesCommon+80 System.Web.HttpApplication.InitModules+64
System.Web.HttpApplication.InitInternalHttpContext上下文,
HttpApplication状态,MethodInfo[]处理程序+792
System.Web.HttpApplicationFactory.GetNormalApplicationInstanceHttpContext
上下文+336
System.Web.HttpApplicationFactory.GetApplicationInstanceHttpContext
上下文+107
System.Web.HttpRuntime.ProcessRequestInternalHttpWorkerRequest wr
+525
我刚刚发现,如果我注释掉这些行,错误将不会出现,站点将正常工作:
<sessionState mode="Custom" cookieless="true" regenerateExpiredSessionId="true" customProvider="MySqlSessionStateProvider">
<providers>
<add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="Sessions" description="Sessions" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True" enableExpireCallback="False" />
</providers>
</sessionState>
我如何修复它,这样我就不必对它进行注释了
编辑:
使用并修复了错误