J'implémente l'authentification personnalisée pour mon application Silverlight. Si ce code dans mon app.xaml: -app.xaml/app.xaml.cs problème authentification personnalisée
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SilverlightCustomAuthExample.App"
xmlns:local="clr-namespace:SilverlightCustomAuthExample"
xmlns:appsvc="clr-namespace:System.ServiceModel.DomainServices.Client.ApplicationServices;assembly=System.ServiceModel.DomainServices.Client.Web"
>
<Application.Resources>
</Application.Resources>
<Application.ApplicationLifetimeObjects>
<local:WebContext>
<local:WebContext.Authentication>
<appsvc:FormsAuthentication/>
</local:WebContext.Authentication>
</local:WebContext>
</Application.ApplicationLifetimeObjects>
</Application>
cela fonctionne très bien. Toutefois, si je tente de faire la même chose dans App.xaml.cs il ne fonctionne pas: -
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();
WebContext.Current.Authentication = new FormsAuthentication();
}
Il dit WebContext.Current
jeté un InvalidOperationException d'exception.
Merci à l'avance :)
Quelle est votre nouvelle app.xaml (dans le cas où il se bloque)? – Timores