我正在尝试在网站开发中使用FitBit API,我想从头开始创建一个网站,但我无法这样做。
我已经按照here描述的步骤进行了操作,并且我在Visual Studio中根据描述的here创建了一个VB.NET网站。我已经下载了OauthNET-Release库,将DLL引用到我的项目中,我的web.config看起来像这样:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<!--<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>-->
<configuration>
<configSections>
<section name="foo" type="bar"/>
<!-- lines omitted -->
</configSections>
<oauth.net.components>
<!-- Components -->
<components>
<!-- Signing provider for HMAC-SHA1 -->
<component service="OAuth.Net.Common.ISigningProvider, OAuth.Net.Common" lifestyle="thread"/>
<!-- Nonce provider -->
<component service="OAuth.Net.Common.INonceProvider, OAuth.Net.Common"/>
<!-- State store -->
<component service="OAuth.Net.Consumer.IRequestStateStore, OAuth.Net.Consumer"/>
</components>
</oauth.net.components>
<!-- lines omitted -->
</configuration>
我试图建立网站,但没有成功,我收到了这条消息:
Error 11 Unrecognized configuration section oauth.net.components.
我的问题是:我该怎么做才能使这项工作成功?先感谢您。
答案 0 :(得分:1)
您是否已将部分注册添加到webconfig的<configSections>
?像这样:
<configSections>
<section name="oauth.net.components" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
<!-- other stuff -->
</configSections>