1

我需要使用 DNOA 创建提供程序。我已经从 DNOA 站点下载了库并尝试加载 oAuthServiceProvider 示例。我无法加载它,因为它正在寻找

\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"

这是 Visual Studio 2010 的一部分,但我在 2008 年。尽管将版本更改为 v9.0,但它仍在寻找 v10.0。没关系。

我将项目作为网站打开并尝试运行它。但现在得到错误“错误 1 ​​无法识别的配置部分 uri。”

关于这里发生了什么的任何想法?下面是网络配置

<?xml version="1.0"?>

<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
     which is necessary for OpenID urls with unicode characters in the domain/host name. 
     It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
<uri>
    <idn enabled="All"/>
    <iriParsing enabled="true"/>
</uri>

<system.net>
    <defaultProxy enabled="true" />
    <settings>
        <!-- This setting causes .NET to check certificate revocation lists (CRL) 
             before trusting HTTPS certificates.  But this setting tends to not 
             be allowed in shared hosting environments. -->
        <!--<servicePointManager checkCertificateRevocationList="true"/>-->
    </settings>
</system.net>

<!-- this is an optional configuration section where aspects of dotnetopenauth can be customized -->
<dotNetOpenAuth>
    <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
    <reporting enabled="true" />
    <messaging>
        <untrustedWebRequest>
            <whitelistHosts>
                <add name="localhost"/>
            </whitelistHosts>
        </untrustedWebRequest>
    </messaging>
</dotNetOpenAuth>

<appSettings/>
<connectionStrings>

<system.web>
    <!-- 
        Set compilation debug="true" to insert debugging 
        symbols into the compiled page. Because this 
        affects performance, set this value to true only 
        during development.
    -->
    <compilation debug="true" targetFramework="4.0">
        <assemblies>
            <remove assembly="DotNetOpenAuth.Contracts"/>
            <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        </assemblies>
    </compilation>
    <authentication mode="Forms">
        <forms name="oauthSP" />
    </authentication>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<!-- 
    The system.webServer section is required for running ASP.NET AJAX under Internet
    Information Services 7.0.  It is not necessary for previous version of IIS.
-->
<log4net>
    <appender name="TracePageAppender" type="OAuthServiceProvider.Code.TracePageAppender, OAuthServiceProvider">
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date (GMT%date{%z}) [%thread] %-5level %logger - %message%newline"/>
        </layout>
    </appender>
    <!-- Setup the root category, add the appenders and set the default level -->
    <root>
        <level value="INFO"/>
        <!--<appender-ref ref="RollingFileAppender" />-->
        <appender-ref ref="TracePageAppender"/>
    </root>
    <!-- Specify the level for some specific categories -->
    <logger name="DotNetOpenAuth">
        <level value="ALL"/>
    </logger>
</log4net>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="DataApiBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
                <serviceAuthorization serviceAuthorizationManagerType="OAuthServiceProvider.Code.OAuthAuthorizationManager, OAuthServiceProvider" principalPermissionMode="Custom"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="DataApiBehavior" name="OAuthServiceProvider.DataApi">
            <endpoint address="" binding="wsHttpBinding" contract="OAuthServiceProvider.Code.IDataApi">
                <identity>
                    <dns value="localhost"/>
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

4

0 回答 0