diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2011-10-07 23:19:31 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2011-10-07 23:20:01 -0700 |
commit | 5c6f516bee9fb12d0972b87d891c35f2ae1b8f22 (patch) | |
tree | 0750740e18866f7c7555a457ebd3591fa68f3950 /src | |
parent | da7f27098a4e066ad63454d4585acb653a3d7a89 (diff) | |
download | DotNetOpenAuth-5c6f516bee9fb12d0972b87d891c35f2ae1b8f22.zip DotNetOpenAuth-5c6f516bee9fb12d0972b87d891c35f2ae1b8f22.tar.gz DotNetOpenAuth-5c6f516bee9fb12d0972b87d891c35f2ae1b8f22.tar.bz2 |
Fixed build breaks when targeting CLR 4.
Diffstat (limited to 'src')
3 files changed, 50 insertions, 14 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Messaging/Bindings/CryptoKeyCollisionException.cs b/src/DotNetOpenAuth.Messaging/Messaging/Bindings/CryptoKeyCollisionException.cs index 11634ac..ebd29de 100644 --- a/src/DotNetOpenAuth.Messaging/Messaging/Bindings/CryptoKeyCollisionException.cs +++ b/src/DotNetOpenAuth.Messaging/Messaging/Bindings/CryptoKeyCollisionException.cs @@ -56,7 +56,7 @@ namespace DotNetOpenAuth.Messaging.Bindings { /// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter"/> /// </PermissionSet> #if CLR4 - [SecurityCritical] + [System.Security.SecurityCritical] #else [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] #endif diff --git a/src/DotNetOpenAuth.Messaging/Requires.cs b/src/DotNetOpenAuth.Messaging/Requires.cs index b570c89..4be6da0 100644 --- a/src/DotNetOpenAuth.Messaging/Requires.cs +++ b/src/DotNetOpenAuth.Messaging/Requires.cs @@ -24,7 +24,10 @@ namespace DotNetOpenAuth { /// <typeparam name="T">The type of the parameter</typeparam> /// <param name="value">The value.</param> /// <param name="parameterName">Name of the parameter.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void NotNull<T>(T value, string parameterName) where T : class { if (value == null) { throw new ArgumentNullException(parameterName); @@ -38,7 +41,10 @@ namespace DotNetOpenAuth { /// </summary> /// <param name="value">The value.</param> /// <param name="parameterName">Name of the parameter.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void NotNullOrEmpty(string value, string parameterName) { NotNull(value, parameterName); True(value.Length > 0, parameterName, Strings.EmptyStringNotAllowed); @@ -51,7 +57,10 @@ namespace DotNetOpenAuth { /// <typeparam name="T">The type of the elements in the sequence.</typeparam> /// <param name="value">The value.</param> /// <param name="parameterName">Name of the parameter.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void NotNullOrEmpty<T>(IEnumerable<T> value, string parameterName) { NotNull(value, parameterName); True(value.Any(), parameterName, Strings.InvalidArgument); @@ -64,7 +73,10 @@ namespace DotNetOpenAuth { /// <typeparam name="T">The type of elements in the sequence.</typeparam> /// <param name="sequence">The sequence.</param> /// <param name="parameterName">Name of the parameter.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void NullOrWithNoNullElements<T>(IEnumerable<T> sequence, string parameterName) where T : class { if (sequence != null) { if (sequence.Any(e => e == null)) { @@ -79,7 +91,10 @@ namespace DotNetOpenAuth { /// <param name="condition">The expression that must evaluate to true to avoid an <see cref="ArgumentOutOfRangeException"/>.</param> /// <param name="parameterName">Name of the parameter.</param> /// <param name="message">The message to include with the exception.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void InRange(bool condition, string parameterName, string message = null) { if (!condition) { throw new ArgumentOutOfRangeException(parameterName, message); @@ -94,7 +109,10 @@ namespace DotNetOpenAuth { /// <param name="condition">The expression that must evaluate to true to avoid an <see cref="ArgumentException"/>.</param> /// <param name="parameterName">Name of the parameter.</param> /// <param name="message">The message to include with the exception.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void True(bool condition, string parameterName = null, string message = null) { if (!condition) { throw new ArgumentException(message ?? Strings.InvalidArgument, parameterName); @@ -110,7 +128,10 @@ namespace DotNetOpenAuth { /// <param name="parameterName">Name of the parameter.</param> /// <param name="unformattedMessage">The unformatted message.</param> /// <param name="args">Formatting arguments.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void True(bool condition, string parameterName, string unformattedMessage, params object[] args) { if (!condition) { throw new ArgumentException(String.Format(unformattedMessage, args), parameterName); @@ -123,7 +144,10 @@ namespace DotNetOpenAuth { /// Validates some expression describing the acceptable condition for an argument evaluates to true. /// </summary> /// <param name="condition">The expression that must evaluate to true to avoid an <see cref="InvalidOperationException"/>.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void ValidState(bool condition) { if (!condition) { throw new InvalidOperationException(); @@ -137,7 +161,10 @@ namespace DotNetOpenAuth { /// </summary> /// <param name="condition">The expression that must evaluate to true to avoid an <see cref="InvalidOperationException"/>.</param> /// <param name="message">The message to include with the exception.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void ValidState(bool condition, string message) { if (!condition) { throw new InvalidOperationException(message); @@ -152,7 +179,10 @@ namespace DotNetOpenAuth { /// <param name="condition">The expression that must evaluate to true to avoid an <see cref="InvalidOperationException"/>.</param> /// <param name="unformattedMessage">The unformatted message.</param> /// <param name="args">Formatting arguments.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void ValidState(bool condition, string unformattedMessage, params object[] args) { if (!condition) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, unformattedMessage, args)); @@ -167,7 +197,10 @@ namespace DotNetOpenAuth { /// <typeparam name="T">The type that the argument must be or derive from.</typeparam> /// <param name="type">The type given in the argument.</param> /// <param name="parameterName">Name of the parameter.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void NotNullSubtype<T>(Type type, string parameterName) { NotNull(type, parameterName); True(typeof(T).IsAssignableFrom(type), parameterName, MessagingStrings.UnexpectedType, typeof(T).FullName, type.FullName); @@ -180,7 +213,10 @@ namespace DotNetOpenAuth { /// </summary> /// <param name="condition">The expression that must evaluate to true to avoid an <see cref="FormatException"/>.</param> /// <param name="message">The message.</param> - [Pure, ContractArgumentValidator, DebuggerStepThrough] +#if !CLR4 + [ContractArgumentValidator] +#endif + [Pure, DebuggerStepThrough] internal static void Format(bool condition, string message) { if (!condition) { throw new FormatException(message); diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/DotNetOpenAuth.OpenId.RelyingParty.UI.csproj b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/DotNetOpenAuth.OpenId.RelyingParty.UI.csproj index 46c8b95..358b2fe 100644 --- a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/DotNetOpenAuth.OpenId.RelyingParty.UI.csproj +++ b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/DotNetOpenAuth.OpenId.RelyingParty.UI.csproj @@ -28,7 +28,7 @@ <Compile Include="OpenId\RelyingParty\OpenIdButton.cs" /> <Compile Include="OpenId\RelyingParty\OpenIdEventArgs.cs" /> <Compile Include="OpenId\RelyingParty\OpenIdLogin.cs" /> - <Compile Include="OpenId\RelyingParty\OpenIdMobileTextBox.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdMobileTextBox.cs" Condition=" '$(ClrVersion)' != '4' "/> <Compile Include="OpenId\RelyingParty\OpenIdRelyingPartyAjaxControlBase.cs" /> <Compile Include="OpenId\RelyingParty\OpenIdRelyingPartyControlBase.cs" /> <Compile Include="OpenId\RelyingParty\OpenIdSelector.cs" /> |