Remove C# code specific to .NET 3.5
The codebase has changed a lot since it was last able to compile
with .NET 3.5, so we don't need this vestigial code.
diff --git a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs
index 4876e09..3810565 100644
--- a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs
+++ b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs
@@ -41,9 +41,7 @@
using System.Runtime.InteropServices;
using System.Threading;
using System.Runtime.CompilerServices;
-#if !NET35
using System.Threading.Tasks;
-#endif
namespace Google.Protobuf
{
@@ -349,7 +347,6 @@
Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}");
}
-#if !NET35
[Test]
public async Task FromStreamAsync_Seekable()
{
@@ -373,7 +370,6 @@
ByteString expected = ByteString.CopyFrom(2, 3, 4);
Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}");
}
-#endif
[Test]
public void GetHashCode_Regression()
diff --git a/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs
index 1f7b8a3..abd19a2 100644
--- a/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs
+++ b/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs
@@ -635,7 +635,6 @@
Assert.IsTrue(input.IsAtEnd);
}
-#if !NET35
[Test]
public void IDictionaryKeys_Equals_IReadOnlyDictionaryKeys()
{
@@ -649,7 +648,6 @@
var map = new MapField<string, string> { { "foo", "bar" }, { "x", "y" } };
CollectionAssert.AreEquivalent(((IDictionary<string, string>)map).Values, ((IReadOnlyDictionary<string, string>)map).Values);
}
-#endif
private static KeyValuePair<TKey, TValue> NewKeyValuePair<TKey, TValue>(TKey key, TValue value)
{
diff --git a/csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs b/csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs
deleted file mode 100644
index 48c0725..0000000
--- a/csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-#if NET35
-using System;
-using System.IO;
-using NUnit.Framework;
-using Google.Protobuf.Compatibility;
-
-namespace Google.Protobuf.Test.Compatibility
-{
- public class StreamExtensionsTest
- {
- [Test]
- public void CopyToNullArgument()
- {
- var memoryStream = new MemoryStream();
- Assert.Throws<ArgumentNullException>(() => memoryStream.CopyTo(null));
- }
-
- [Test]
- public void CopyToTest()
- {
- byte[] bytesToStream = new byte[] { 0x31, 0x08, 0xFF, 0x00 };
- Stream source = new MemoryStream(bytesToStream);
- Stream destination = new MemoryStream((int)source.Length);
- source.CopyTo(destination);
- destination.Seek(0, SeekOrigin.Begin);
-
- Assert.AreEqual(0x31, destination.ReadByte());
- Assert.AreEqual(0x08, destination.ReadByte());
- Assert.AreEqual(0xFF, destination.ReadByte());
- Assert.AreEqual(0x00, destination.ReadByte());
- Assert.AreEqual(-1, destination.ReadByte());
- }
- }
-}
-#endif
diff --git a/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs b/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
index 5d86c20..1d69fcb 100644
--- a/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
+++ b/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
@@ -34,7 +34,6 @@
using System.Collections.Generic;
using System.Reflection;
-#if !NET35
namespace Google.Protobuf.Compatibility
{
public class TypeExtensionsTest
@@ -114,4 +113,3 @@
}
}
}
-#endif
diff --git a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs
index 7f36692..4f2a562 100644
--- a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs
+++ b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs
@@ -169,7 +169,6 @@
// WriteTagAndValue ignores default values
var stream = new MemoryStream();
CodedOutputStream codedOutput;
-#if !NET35
codedOutput = new CodedOutputStream(stream);
codec.WriteTagAndValue(codedOutput, codec.DefaultValue);
codedOutput.Flush();
@@ -179,7 +178,6 @@
{
Assert.AreEqual(default(T), codec.DefaultValue);
}
-#endif
// The plain ValueWriter/ValueReader delegates don't.
if (codec.DefaultValue != null) // This part isn't appropriate for message types.
diff --git a/csharp/src/Google.Protobuf/ByteString.cs b/csharp/src/Google.Protobuf/ByteString.cs
index 8c6eb5b..c615616 100644
--- a/csharp/src/Google.Protobuf/ByteString.cs
+++ b/csharp/src/Google.Protobuf/ByteString.cs
@@ -37,13 +37,8 @@
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
-#if !NET35
using System.Threading;
using System.Threading.Tasks;
-#endif
-#if NET35
-using Google.Protobuf.Compatibility;
-#endif
namespace Google.Protobuf
{
@@ -186,7 +181,6 @@
return AttachBytes(bytes);
}
-#if !NET35
/// <summary>
/// Constructs a <see cref="ByteString"/> from data in the given stream, asynchronously.
/// </summary>
@@ -200,7 +194,6 @@
ProtoPreconditions.CheckNotNull(stream, nameof(stream));
return ByteStringAsync.FromStreamAsyncCore(stream, cancellationToken);
}
-#endif
/// <summary>
/// Constructs a <see cref="ByteString" /> from the given array. The contents
diff --git a/csharp/src/Google.Protobuf/ByteStringAsync.cs b/csharp/src/Google.Protobuf/ByteStringAsync.cs
index 3465cc6..5aa92f0 100644
--- a/csharp/src/Google.Protobuf/ByteStringAsync.cs
+++ b/csharp/src/Google.Protobuf/ByteStringAsync.cs
@@ -43,7 +43,6 @@
/// </summary>
internal static class ByteStringAsync
{
-#if !NET35
internal static async Task<ByteString> FromStreamAsyncCore(Stream stream, CancellationToken cancellationToken)
{
int capacity = stream.CanSeek ? checked((int)(stream.Length - stream.Position)) : 0;
@@ -59,6 +58,5 @@
#endif
return ByteString.AttachBytes(bytes);
}
-#endif
}
}
\ No newline at end of file
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs
index e5217f4..0f02d59 100644
--- a/csharp/src/Google.Protobuf/Collections/MapField.cs
+++ b/csharp/src/Google.Protobuf/Collections/MapField.cs
@@ -68,10 +68,7 @@
/// in future versions.
/// </para>
/// </remarks>
- public sealed class MapField<TKey, TValue> : IDeepCloneable<MapField<TKey, TValue>>, IDictionary<TKey, TValue>, IEquatable<MapField<TKey, TValue>>, IDictionary
-#if !NET35
- , IReadOnlyDictionary<TKey, TValue>
-#endif
+ public sealed class MapField<TKey, TValue> : IDeepCloneable<MapField<TKey, TValue>>, IDictionary<TKey, TValue>, IEquatable<MapField<TKey, TValue>>, IDictionary, IReadOnlyDictionary<TKey, TValue>
{
private static readonly EqualityComparer<TValue> ValueEqualityComparer = ProtobufEqualityComparers.GetEqualityComparer<TValue>();
private static readonly EqualityComparer<TKey> KeyEqualityComparer = ProtobufEqualityComparers.GetEqualityComparer<TKey>();
@@ -600,11 +597,8 @@
#endregion
#region IReadOnlyDictionary explicit interface implementation
-#if !NET35
IEnumerable<TKey> IReadOnlyDictionary<TKey, TValue>.Keys => Keys;
-
IEnumerable<TValue> IReadOnlyDictionary<TKey, TValue>.Values => Values;
-#endif
#endregion
private class DictionaryEnumerator : IDictionaryEnumerator
diff --git a/csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs b/csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs
deleted file mode 100644
index 28530a2..0000000
--- a/csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace Google.Protobuf.Collections
-{
- /// <summary>
- /// Read-only wrapper around another dictionary.
- /// </summary>
- internal sealed class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>
- {
- private readonly IDictionary<TKey, TValue> wrapped;
-
- public ReadOnlyDictionary(IDictionary<TKey, TValue> wrapped)
- {
- this.wrapped = wrapped;
- }
-
- public void Add(TKey key, TValue value)
- {
- throw new InvalidOperationException();
- }
-
- public bool ContainsKey(TKey key)
- {
- return wrapped.ContainsKey(key);
- }
-
- public ICollection<TKey> Keys
- {
- get { return wrapped.Keys; }
- }
-
- public bool Remove(TKey key)
- {
- throw new InvalidOperationException();
- }
-
- public bool TryGetValue(TKey key, out TValue value)
- {
- return wrapped.TryGetValue(key, out value);
- }
-
- public ICollection<TValue> Values
- {
- get { return wrapped.Values; }
- }
-
- public TValue this[TKey key]
- {
- get { return wrapped[key]; }
- set { throw new InvalidOperationException(); }
- }
-
- public void Add(KeyValuePair<TKey, TValue> item)
- {
- throw new InvalidOperationException();
- }
-
- public void Clear()
- {
- throw new InvalidOperationException();
- }
-
- public bool Contains(KeyValuePair<TKey, TValue> item)
- {
- return wrapped.Contains(item);
- }
-
- public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
- {
- wrapped.CopyTo(array, arrayIndex);
- }
-
- public int Count
- {
- get { return wrapped.Count; }
- }
-
- public bool IsReadOnly
- {
- get { return true; }
- }
-
- public bool Remove(KeyValuePair<TKey, TValue> item)
- {
- throw new InvalidOperationException();
- }
-
- public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
- {
- return wrapped.GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return ((IEnumerable) wrapped).GetEnumerator();
- }
-
- public override bool Equals(object obj)
- {
- return wrapped.Equals(obj);
- }
-
- public override int GetHashCode()
- {
- return wrapped.GetHashCode();
- }
-
- public override string ToString()
- {
- return wrapped.ToString();
- }
- }
-}
\ No newline at end of file
diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
index 9269c74..cd6f5eb 100644
--- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
+++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
@@ -48,10 +48,7 @@
/// supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases.
/// </remarks>
/// <typeparam name="T">The element type of the repeated field.</typeparam>
- public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>>
-#if !NET35
- , IReadOnlyList<T>
-#endif
+ public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>>, IReadOnlyList<T>
{
private static readonly EqualityComparer<T> EqualityComparer = ProtobufEqualityComparers.GetEqualityComparer<T>();
private static readonly T[] EmptyArray = new T[0];
diff --git a/csharp/src/Google.Protobuf/Compatibility/MethodInfoExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/MethodInfoExtensions.cs
deleted file mode 100644
index 7b946cb..0000000
--- a/csharp/src/Google.Protobuf/Compatibility/MethodInfoExtensions.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2017 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-#if NET35
-using System;
-using System.Reflection;
-
-namespace Google.Protobuf.Compatibility
-{
- // .NET Core (at least netstandard1.0) doesn't have Delegate.CreateDelegate, and .NET 3.5 doesn't have
- // MethodInfo.CreateDelegate. Proxy from one to the other on .NET 3.5...
- internal static class MethodInfoExtensions
- {
- internal static Delegate CreateDelegate(this MethodInfo method, Type type) =>
- Delegate.CreateDelegate(type, method);
- }
-}
-#endif
diff --git a/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs
index 95a02c7..8a6fefa 100644
--- a/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs
+++ b/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs
@@ -47,11 +47,7 @@
/// </summary>
internal static MethodInfo GetGetMethod(this PropertyInfo target)
{
-#if NET35
- var method = target.GetGetMethod();
-#else
var method = target.GetMethod;
-#endif
return method != null && method.IsPublic ? method : null;
}
@@ -61,11 +57,7 @@
/// </summary>
internal static MethodInfo GetSetMethod(this PropertyInfo target)
{
-#if NET35
- var method = target.GetSetMethod();
-#else
var method = target.SetMethod;
-#endif
return method != null && method.IsPublic ? method : null;
}
}
diff --git a/csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs
deleted file mode 100644
index bf4bf22..0000000
--- a/csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-#if NET35
-using System;
-using System.IO;
-
-namespace Google.Protobuf.Compatibility
-{
- /// <summary>
- /// Extension methods for <see cref="Stream"/> in order to provide
- /// backwards compatibility with .NET 3.5
- /// </summary>
- public static class StreamExtensions
- {
- // 81920 seems to be the default buffer size used in .NET 4.5.1
- private const int BUFFER_SIZE = 81920;
-
- /// <summary>
- /// Write the contents of the current stream to the destination stream
- /// </summary>
- public static void CopyTo(this Stream source, Stream destination)
- {
- if (destination == null)
- {
- throw new ArgumentNullException(nameof(destination));
- }
-
- byte[] buffer = new byte[BUFFER_SIZE];
- int numBytesRead;
- while ((numBytesRead = source.Read(buffer, 0, buffer.Length)) > 0) {
- destination.Write(buffer, 0, numBytesRead);
- }
- }
- }
-}
-#endif
diff --git a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs
index b3acda2..5db5dca 100644
--- a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs
+++ b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs
@@ -34,7 +34,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
-#if !NET35
namespace Google.Protobuf.Compatibility
{
/// <summary>
@@ -112,4 +111,3 @@
}
}
}
-#endif
diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
index 40a6ff8..415b7be 100644
--- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
@@ -36,10 +36,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
-#if NET35
-// Needed for ReadOnlyDictionary, which does not exist in .NET 3.5
-using Google.Protobuf.Collections;
-#endif
namespace Google.Protobuf.Reflection
{
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs
index 58a33cb..dd00e2d 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs
@@ -63,12 +63,7 @@
if (firstInvalid == null)
{
var writer = new StringWriter();
-#if NET35
- var query = paths.Select(JsonFormatter.ToJsonName);
- JsonFormatter.WriteString(writer, string.Join(",", query.ToArray()));
-#else
JsonFormatter.WriteString(writer, string.Join(",", paths.Select(JsonFormatter.ToJsonName)));
-#endif
return writer.ToString();
}
else