Site feedback

PeterFleischer-3316 avatar image
4 Votes"
PeterFleischer-3316 Posted ·

Error Page: WAF v2 has determined your request exceeded the normal web request and has blocked your request.

Posting answer with code I get an error. What can I do?

6843-unbenannt.png


QnA
unbenannt.png (59.5 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardMueller-8175 avatar image
0 Votes"
RichardMueller-8175 Posted ·

WAF is "Azure Web Application Firewall (WAF) on Azure Application Gateway".

· 5
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Richard, what can I do? I posted answer or reply in https://docs.microsoft.com/answers/topics/wpf.html and get this error when I add code (XAML, VB.NET) in my answer. Without code reply and answer are accepted. AlexLI-MSFT posted the same code in his answer without problems (see https://docs.microsoft.com/answers/questions/21003/rowvalidationerrortemplate-as-a-static-resources.html).

0 Votes 0 ·

@PeterFleischer-3316 - I can assist here, I will need to look at the whole context of your post to determine what is getting tripped by the WAF. Is it possible for you to past the context of the body in this comment?

0 Votes 0 ·

I wrote a comment (text, XAML VB.NET) here and get the same error.

text :I wrote:

When you inform the UI, the PropertyChanged event automatically triggers the start of the refreshing process. This process will be executed in the UI thread. You don't need to use Invoke to marshall it explicitly.

Note that it is only true for change notifications on scalar properties (i.e. PropertyChanged event). Collection change notifications (INotifyCollectionChanged.CollectionChanged event) don't work that way, they must be raised on the UI thread manually.

Own code in the event routine of PropertyChanged is executed in the thread in which PropertyChanged was raised. An error is occured when objects that are not thread-safe are accessed in this event routine (e.g. UI controls).

0 Votes 0 ·

I want write the XAML and the Comment is not submitted

0 Votes 0 ·

I detect, if I switch from Source to Preview the window is empty and after "Post Comment" I get the error.

0 Votes 0 ·
PeterFleischer-3316 avatar image
0 Votes"
PeterFleischer-3316 Posted ·

The code I wrote:

 Imports System.Collections.ObjectModel
 Imports System.ComponentModel
 Imports System.Runtime.CompilerServices
 Imports System.Threading
 Imports System.Windows.Threading
    
 Public Class Window97
   Public Sub New()
    
     ' This call is required by the designer.
     InitializeComponent()
    
     ' Add any initialization after the InitializeComponent() call.
     Dim vm As New Window97VM(AddressOf prot)
     Me.DataContext = vm
   End Sub
    
   Private Sub prot(msg As String)
     Me.lbProt.Items.Add(msg)
   End Sub
 End Class
    
 Public Class Window97VM
    
   Private rnd As New Random
   Public Sub New(p As Action(Of String))
     For i = 1 To 100
       Dim d As New Window97Data With {.LinkName = $"Link {i} noready", .NaviUri = "http://www.microsoft.com", .Ready = False}
       AddHandler d.PropertyChanged, Sub(sender, e)
                                       ' comment this out for test without UI dispatcher
                                       p($"NotifyPropertyChanged in {e.PropertyName}")
                                     End Sub
       col.Add(d)
     Next
     cvs.Source = col
     '
     ThreadPool.SetMaxThreads(3, 3)
     For Each item As Window97Data In col
       ThreadPool.QueueUserWorkItem(Sub(state)
                                      item.Execute(CType(state, Integer))
                                    End Sub, rnd.Next(500, 2000))
     Next
   End Sub
    
   Private col As New ObservableCollection(Of Window97Data)
   Private cvs As New CollectionViewSource
    
   Public ReadOnly Property View As ICollectionView
     Get
       Return cvs.View
     End Get
   End Property
    
 End Class
    
 Public Class Window97Data
   Implements INotifyPropertyChanged
   Public Property LinkName As String
   Public Property NaviUri As String
   Public Property Ready As Boolean
    
   Private uiDispatcher As Dispatcher = Dispatcher.CurrentDispatcher
    
   Friend Sub Execute(par As Integer)
     Thread.Sleep(par)
     LinkName = LinkName.Replace("noready", "ready")
     Ready = True
     ' comment tis out for test without UI dispatcher
     'uiDispatcher.Invoke(New Action(Sub()
     OnPropChanged(NameOf(LinkName))
     OnPropChanged(NameOf(Ready))
     'End Sub))
   End Sub
    
   Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
   Private Sub OnPropChanged(<CallerMemberName> Optional propName As String = "")
     RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
   End Sub
 End Class
· 5
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PeterFleischer-3316 - is this the whole post or just the code? Can you provide the whole post content?

0 Votes 0 ·

The whole post contains text (see below), XAML (Icannot write because error) and VB-Code (see below).

the XAML contains Window-Tag, StackPanel, ListBox, ListBox.ItemTemplate, DataTemplate, TextBlock, Hyperlink, Run

0 Votes 0 ·

this is a part of XAML

 <Window x:Class="Window97"
 ...
         Title="Window97" Height="450" Width="800">
   <StackPanel>
     <ListBox ItemsSource="{Binding View}" Height="200">
       <ListBox.ItemTemplate>
         <DataTemplate>
           <TextBlock>            
             <Hyperlink NavigateUri="{Binding NaviUri}" IsEnabled="{Binding Ready}">
               <Run Text="{Binding LinkName}"/> 
             </Hyperlink>
           </TextBlock>
         </DataTemplate>
       </ListBox.ItemTemplate>
     </ListBox>
     <ListBox x:Name="lbProt" Height="200"/>
   </StackPanel>
 </Window>
0 Votes 0 ·
Show more comments
PeterFleischer-3316 avatar image
0 Votes"
PeterFleischer-3316 Posted ·

This was another post with error

Hi, include your ControlTemplate in Application.xaml for app-wide using

 <Application x:Class="Application"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:local="clr-namespace:WpfApp1"
     StartupUri="Window98.xaml">
    
   <Application.Resources>
     <ControlTemplate x:Key="template1">
       <Grid Margin="0,-2,0,-2"
                                 ToolTip="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}},
                                                   Path=(Validation.Errors)[0].ErrorContent}">
         <Ellipse StrokeThickness="0" 
                                        Fill="Red" 
                                        Width="{TemplateBinding FontSize}" 
                                        Height="{TemplateBinding FontSize}" />
         <TextBlock Text="!" 
                                          FontSize="{TemplateBinding FontSize}" 
                                          FontWeight="Bold" 
                                          Foreground="White" 
                                          HorizontalAlignment="Center"  />
       </Grid>
     </ControlTemplate>
   </Application.Resources>
 </Application>
· 4
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


@PeterFleischer-3316 - Please try posting this on the intended answer for the question and let me know.

0 Votes 0 ·

@PeterFleischer-3316 - Thanks for confirming that, please ask the community to reach out on this feedback post so that we can track and mitigate false-positives.

0 Votes 0 ·
Show more comments
pituach avatar image
0 Votes"
pituach Posted ·

I am getting the same issue, and my message is not longer then my average messages in the MSDN forums and it does not include any code!

8720-forumbug.png

The original trhead is here:

https://docs.microsoft.com/en-us/answers/questions/30365/odbc-system-dsn-cannot-store-user-password-azure-s.html


10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

saldana-msft avatar image
0 Votes"
saldana-msft Posted ·

While we work on the long-term fix and on a autosave/draft capability (on the works), please make sure you preview your post before submitting. We just post a post about this: Access denied error when posting content.html.


10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

saldana-msft avatar image
0 Votes"
saldana-msft Posted ·

@PeterFleischer-3316 @JamesLee-6787 @pituach


The majority of the WAF issues are fixed. So I am going to close this as resolved. Thank you all for your feedback!


cc @aman-singh


10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Your Opinion Counts

Share your feedback, or help out by voting for other people's feedback.