List of Input Values which will cause the “A potentially dangerous Request.Form value was detected…” error

I know the < and > characters will cause this error, but what other characters/inputs will cause this error? I’m testing for this error in the Global.asax, and reridrecting to an error page where I want to list all possible values which cause this error, so the user can go back to their page and … Read more

How to prevent Visual Studio from “publishing” XML documentation files in web projects?

Note: This question is similar to How to prevent the copy of XML documentation files in a release mode build?, but it’s not the same and the answers there don’t apply. Read on to find out why. (Please ask in the comments or in chat if you disagree, I’ll be glad to elaborate). I have … Read more

Problems using JSON.NET with ExpandableObjectConverter

I have the following class defined: <TypeConverter(GetType(ExpandableObjectConverter))> <DataContract()> Public Class Vector3 <DataMember()> Public Property X As Double <DataMember()> Public Property Y As Double <DataMember()> Public Property Z As Double Public Overrides Function ToString() As String Return String.Format(“({0}, {1}, {2})”, Format(X, “0.00”), Format(Y, “0.00”), Format(Z, “0.00”)) End Function End Class Using the DataContractJsonSerializer I receive the … Read more

Extension methods in referenced assemblies?

If I try to call my extension method which is defined like this: Module LinqExtensions <System.Runtime.CompilerServices.Extension()> _ Public Function ToSortableBindingList(Of TSource)(ByVal source As IEnumerable(Of TSource)) As IBindingList If (source Is Nothing) Then Throw New ArgumentNullException(“source”) End If Return New SortableBindingList(Of TSource)(New List(Of TSource)(source)) End Function End Module by calling Dim sss As String() sss.AsEnumerable.ToSortableBindingList() it … Read more

Could not establish secure channel for SSL/TLS for SOAP call

Our core server is calling out to a soap web service over https on a number of different servers to confirm that a transaction has completed. The code is dotnet 3.5 (vb) and works for the various callback services we have set up until we just moved a new one into production and it is … Read more

C# equivalent of VB DLL function declaration (InternetSetOption)?

What is the C# equivalent of this VB code? Private Declare Auto Function InternetSetOption Lib “wininet.dll” (ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean Answer Here it is: [DllImport(“wininet.dll”, SetLastError = true, CharSet = CharSet.Auto)] public static extern bool InternetSetOption( IntPtr hInternet, int dwOption, IntPtr … Read more