none
ria services自定义用户身份验证的问题 RRS feed

  • 问题


  • 我正在学习ria services自定义用户身份验证,参考学习的网址是:http://www.funsl.com/content/net-ria-services-custom-authentication 但它是3.0版,我改成4.0版的,App.xaml却是总是出错。

    Web.config:

    <?xml version="1.0" encoding="utf-8"?>

    <!--
      有关如何配置 ASP.NET 应用程序的详细消息,请访问
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->

    <configuration>
        <system.webServer>
            <modules runAllManagedModulesForAllRequests="true">
                <add name="DomainServiceModule" preCondition="managedHandler"
                    type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            </modules>
            <validation validateIntegratedModeConfiguration="false" />
        </system.webServer>
        <system.web>
            <httpModules>
                <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            </httpModules>
            <compilation debug="true" targetFramework="4.0" />
            <authentication mode="Forms">
               
            </authentication>
        </system.web>

        <system.serviceModel>
            <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
                multipleSiteBindingsEnabled="true" />
        </system.serviceModel>
    </configuration>

     


    App.xaml:

    <Application
      x:Class="Authen.App"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:app="clr-namespace:Authen"
      xmlns:appsvc="System.ServiceModel.DomainServices.Server;assembly=System.Windows.Ria"
    >
                
        <Application.ApplicationLifetimeObjects>
            <app:WebContext>
                <app:WebContext.Authentication>
                    <appsvc:FormsAuthentication DomainContextType="Authen.Web"></appsvc:FormsAuthentication>
                </app:WebContext.Authentication>
            </app:WebContext>
        </Application.ApplicationLifetimeObjects>

    </Application>

    编绎时App.xaml老是出错:(1)The tag 'FormsAuthentication' does not exist in XML namespace 'System.ServiceModel.DomainServices.Server;assembly=System.Windows.Ria'.
    (2)未找到类型“appsvc:FormsAuthentication”。请确保不缺少程序集引用,并且已生成所有引用的程序集

    (3)未找到类型“app:WebContext”。

    请问怎么修改呢?先谢谢各位了

     

    2010年10月30日 6:57

答案

全部回复