C#-沙发上的会话状态
作者:互联网
我想使用couchbase进行会话.我配置了我的Web配置.应用框架也是net 4.5.
这是我的web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<section name="couchbase-caching" type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient" />
</configSections>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<couchbase-caching>
<servers bucket="session" bucketPassword="">
<add uri="*********************" />
</servers>
</couchbase-caching>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<sessionState customProvider="Couchbase" mode="Custom">
<providers>
<add name="Couchbase" type="Couchbase.AspNet.SessionState.CouchbaseSessionStateProvider, Couchbase.AspNet" section="couchbase-caching" factory="Couchbase.AspNet.CouchbaseClientFactory" exclusiveAccess="false" />
</providers>
</sessionState>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我找不到为什么会收到此错误.
当我想运行它时,我得到这个错误:
谁能帮我,谢谢.
解决方法:
我有一个类似的问题,下面的配置对我有用. “ Bucket”应该是元素,而不是属性,而“ bucketPassword”属性应该是“ password”.
<couchbase-caching>
<servers>
<add uri="*********************" />
</servers>
<buckets>
<add name = "session" password=""> </add>
</buckets>
</couchbase-caching>
标签:session-state,net-4-5-2,c,asp-net-mvc,couchbase 来源: https://codeday.me/bug/20191120/2045066.html