From 7a3ee6a3a32e2f1b2820ad06e4565143577f007e Mon Sep 17 00:00:00 2001
From: Jan Tattermusch <jtattermusch@google.com>
Date: Thu, 18 Feb 2016 10:36:02 -0800
Subject: [PATCH] rename Preconditions to GrpcPreconditions

---
 .../Grpc.Auth/GoogleAuthInterceptors.cs       |  2 +-
 src/csharp/Grpc.Core/AsyncAuthInterceptor.cs  |  4 +--
 src/csharp/Grpc.Core/CallCredentials.cs       |  4 +--
 src/csharp/Grpc.Core/CallInvocationDetails.cs |  8 ++---
 src/csharp/Grpc.Core/CallOptions.cs           |  4 +--
 src/csharp/Grpc.Core/Channel.cs               |  8 ++---
 src/csharp/Grpc.Core/ChannelCredentials.cs    |  6 ++--
 src/csharp/Grpc.Core/ChannelOptions.cs        | 10 +++----
 .../Grpc.Core/ContextPropagationToken.cs      |  2 +-
 src/csharp/Grpc.Core/Grpc.Core.csproj         |  5 ++--
 src/csharp/Grpc.Core/GrpcEnvironment.cs       |  4 +--
 src/csharp/Grpc.Core/Internal/AsyncCall.cs    | 16 +++++-----
 .../Grpc.Core/Internal/AsyncCallBase.cs       | 30 +++++++++----------
 .../Grpc.Core/Internal/AsyncCallServer.cs     | 18 +++++------
 .../Internal/CompletionQueueSafeHandle.cs     |  2 +-
 .../Grpc.Core/Internal/CompletionRegistry.cs  |  4 +--
 src/csharp/Grpc.Core/Internal/Enums.cs        |  2 +-
 .../NativeMetadataCredentialsPlugin.cs        |  2 +-
 .../Grpc.Core/Internal/ServerCallHandler.cs   |  8 ++---
 .../Internal/ServerCredentialsSafeHandle.cs   |  2 +-
 src/csharp/Grpc.Core/Internal/Timespec.cs     |  6 ++--
 .../Grpc.Core/Internal/UnmanagedLibrary.cs    |  2 +-
 src/csharp/Grpc.Core/KeyCertificatePair.cs    |  4 +--
 src/csharp/Grpc.Core/Marshaller.cs            |  4 +--
 src/csharp/Grpc.Core/Metadata.cs              | 16 +++++-----
 src/csharp/Grpc.Core/Method.cs                |  8 ++---
 src/csharp/Grpc.Core/Server.cs                | 18 +++++------
 src/csharp/Grpc.Core/ServerCredentials.cs     |  4 +--
 src/csharp/Grpc.Core/ServerPort.cs            |  4 +--
 ...{Preconditions.cs => GrpcPreconditions.cs} |  2 +-
 .../Grpc.HealthCheck/HealthServiceImpl.cs     |  4 +--
 .../Grpc.IntegrationTesting/ClientRunners.cs  |  4 +--
 .../Grpc.IntegrationTesting/Histogram.cs      |  4 +--
 .../Grpc.IntegrationTesting/ServerRunners.cs  |  4 +--
 .../WorkerServiceImpl.cs                      |  4 +--
 35 files changed, 114 insertions(+), 115 deletions(-)
 rename src/csharp/Grpc.Core/Utils/{Preconditions.cs => GrpcPreconditions.cs} (99%)

diff --git a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
index f77e9c6573..96d6ee87ae 100644
--- a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
+++ b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
@@ -71,7 +71,7 @@ namespace Grpc.Auth
         /// <returns>The interceptor.</returns>
         public static AsyncAuthInterceptor FromAccessToken(string accessToken)
         {
-            Preconditions.CheckNotNull(accessToken);
+            GrpcPreconditions.CheckNotNull(accessToken);
             return new AsyncAuthInterceptor(async (context, metadata) =>
             {
                 metadata.Add(CreateBearerTokenHeader(accessToken));
diff --git a/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs b/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs
index 5c9ab04812..1ad2290928 100644
--- a/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs
+++ b/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs
@@ -61,8 +61,8 @@ namespace Grpc.Core
         /// </summary>
         public AuthInterceptorContext(string serviceUrl, string methodName)
         {
-            this.serviceUrl = Preconditions.CheckNotNull(serviceUrl);
-            this.methodName = Preconditions.CheckNotNull(methodName);
+            this.serviceUrl = GrpcPreconditions.CheckNotNull(serviceUrl);
+            this.methodName = GrpcPreconditions.CheckNotNull(methodName);
         }
 
         /// <summary>
diff --git a/src/csharp/Grpc.Core/CallCredentials.cs b/src/csharp/Grpc.Core/CallCredentials.cs
index a71c8904fe..7476b0ca16 100644
--- a/src/csharp/Grpc.Core/CallCredentials.cs
+++ b/src/csharp/Grpc.Core/CallCredentials.cs
@@ -87,7 +87,7 @@ namespace Grpc.Core
         /// <param name="interceptor">authentication interceptor</param>
         public MetadataCredentials(AsyncAuthInterceptor interceptor)
         {
-            this.interceptor = Preconditions.CheckNotNull(interceptor);
+            this.interceptor = GrpcPreconditions.CheckNotNull(interceptor);
         }
 
         internal override CallCredentialsSafeHandle ToNativeCredentials()
@@ -111,7 +111,7 @@ namespace Grpc.Core
         /// <param name="credentials">credentials to compose</param>
         public CompositeCallCredentials(params CallCredentials[] credentials)
         {
-            Preconditions.CheckArgument(credentials.Length >= 2, "Composite credentials object can only be created from 2 or more credentials.");
+            GrpcPreconditions.CheckArgument(credentials.Length >= 2, "Composite credentials object can only be created from 2 or more credentials.");
             this.credentials = new List<CallCredentials>(credentials);
         }
 
diff --git a/src/csharp/Grpc.Core/CallInvocationDetails.cs b/src/csharp/Grpc.Core/CallInvocationDetails.cs
index 8228b8f317..98db854614 100644
--- a/src/csharp/Grpc.Core/CallInvocationDetails.cs
+++ b/src/csharp/Grpc.Core/CallInvocationDetails.cs
@@ -85,11 +85,11 @@ namespace Grpc.Core
         /// <param name="options">Call options.</param>
         public CallInvocationDetails(Channel channel, string method, string host, Marshaller<TRequest> requestMarshaller, Marshaller<TResponse> responseMarshaller, CallOptions options)
         {
-            this.channel = Preconditions.CheckNotNull(channel, "channel");
-            this.method = Preconditions.CheckNotNull(method, "method");
+            this.channel = GrpcPreconditions.CheckNotNull(channel, "channel");
+            this.method = GrpcPreconditions.CheckNotNull(method, "method");
             this.host = host;
-            this.requestMarshaller = Preconditions.CheckNotNull(requestMarshaller, "requestMarshaller");
-            this.responseMarshaller = Preconditions.CheckNotNull(responseMarshaller, "responseMarshaller");
+            this.requestMarshaller = GrpcPreconditions.CheckNotNull(requestMarshaller, "requestMarshaller");
+            this.responseMarshaller = GrpcPreconditions.CheckNotNull(responseMarshaller, "responseMarshaller");
             this.options = options;
         }
 
diff --git a/src/csharp/Grpc.Core/CallOptions.cs b/src/csharp/Grpc.Core/CallOptions.cs
index 1fda80cb90..caf8210d91 100644
--- a/src/csharp/Grpc.Core/CallOptions.cs
+++ b/src/csharp/Grpc.Core/CallOptions.cs
@@ -176,13 +176,13 @@ namespace Grpc.Core
             {
                 if (propagationToken.Options.IsPropagateDeadline)
                 {
-                    Preconditions.CheckArgument(!newOptions.deadline.HasValue,
+                    GrpcPreconditions.CheckArgument(!newOptions.deadline.HasValue,
                         "Cannot propagate deadline from parent call. The deadline has already been set explicitly.");
                     newOptions.deadline = propagationToken.ParentDeadline;
                 }
                 if (propagationToken.Options.IsPropagateCancellation)
                 {
-                    Preconditions.CheckArgument(!newOptions.cancellationToken.CanBeCanceled,
+                    GrpcPreconditions.CheckArgument(!newOptions.cancellationToken.CanBeCanceled,
                         "Cannot propagate cancellation token from parent call. The cancellation token has already been set to a non-default value.");
                     newOptions.cancellationToken = propagationToken.ParentCancellationToken;
                 }
diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs
index d8d43c7998..89981b1849 100644
--- a/src/csharp/Grpc.Core/Channel.cs
+++ b/src/csharp/Grpc.Core/Channel.cs
@@ -68,7 +68,7 @@ namespace Grpc.Core
         /// <param name="options">Channel options.</param>
         public Channel(string target, ChannelCredentials credentials, IEnumerable<ChannelOption> options = null)
         {
-            this.target = Preconditions.CheckNotNull(target, "target");
+            this.target = GrpcPreconditions.CheckNotNull(target, "target");
             this.options = CreateOptionsDictionary(options);
             EnsureUserAgentChannelOption(this.options);
             this.environment = GrpcEnvironment.AddRef();
@@ -117,7 +117,7 @@ namespace Grpc.Core
         /// </summary>
         public Task WaitForStateChangedAsync(ChannelState lastObservedState, DateTime? deadline = null)
         {
-            Preconditions.CheckArgument(lastObservedState != ChannelState.FatalFailure,
+            GrpcPreconditions.CheckArgument(lastObservedState != ChannelState.FatalFailure,
                 "FatalFailure is a terminal state. No further state changes can occur.");
             var tcs = new TaskCompletionSource<object>();
             var deadlineTimespec = deadline.HasValue ? Timespec.FromDateTime(deadline.Value) : Timespec.InfFuture;
@@ -184,7 +184,7 @@ namespace Grpc.Core
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!shutdownRequested);
+                GrpcPreconditions.CheckState(!shutdownRequested);
                 shutdownRequested = true;
             }
 
@@ -221,7 +221,7 @@ namespace Grpc.Core
 
             bool success = false;
             handle.DangerousAddRef(ref success);
-            Preconditions.CheckState(success);
+            GrpcPreconditions.CheckState(success);
         }
 
         internal void RemoveCallReference(object call)
diff --git a/src/csharp/Grpc.Core/ChannelCredentials.cs b/src/csharp/Grpc.Core/ChannelCredentials.cs
index 5d96958e7c..db0cefef8b 100644
--- a/src/csharp/Grpc.Core/ChannelCredentials.cs
+++ b/src/csharp/Grpc.Core/ChannelCredentials.cs
@@ -183,9 +183,9 @@ namespace Grpc.Core
         /// <param name="callCredentials">channelCredentials to compose</param>
         public CompositeChannelCredentials(ChannelCredentials channelCredentials, CallCredentials callCredentials)
         {
-            this.channelCredentials = Preconditions.CheckNotNull(channelCredentials);
-            this.callCredentials = Preconditions.CheckNotNull(callCredentials);
-            Preconditions.CheckArgument(channelCredentials.IsComposable, "Supplied channel credentials do not allow composition.");
+            this.channelCredentials = GrpcPreconditions.CheckNotNull(channelCredentials);
+            this.callCredentials = GrpcPreconditions.CheckNotNull(callCredentials);
+            GrpcPreconditions.CheckArgument(channelCredentials.IsComposable, "Supplied channel credentials do not allow composition.");
         }
 
         internal override ChannelCredentialsSafeHandle ToNativeCredentials()
diff --git a/src/csharp/Grpc.Core/ChannelOptions.cs b/src/csharp/Grpc.Core/ChannelOptions.cs
index d70673cf78..b6eeceabc4 100644
--- a/src/csharp/Grpc.Core/ChannelOptions.cs
+++ b/src/csharp/Grpc.Core/ChannelOptions.cs
@@ -73,8 +73,8 @@ namespace Grpc.Core
         public ChannelOption(string name, string stringValue)
         {
             this.type = OptionType.String;
-            this.name = Preconditions.CheckNotNull(name, "name");
-            this.stringValue = Preconditions.CheckNotNull(stringValue, "stringValue");
+            this.name = GrpcPreconditions.CheckNotNull(name, "name");
+            this.stringValue = GrpcPreconditions.CheckNotNull(stringValue, "stringValue");
         }
 
         /// <summary>
@@ -85,7 +85,7 @@ namespace Grpc.Core
         public ChannelOption(string name, int intValue)
         {
             this.type = OptionType.Integer;
-            this.name = Preconditions.CheckNotNull(name, "name");
+            this.name = GrpcPreconditions.CheckNotNull(name, "name");
             this.intValue = intValue;
         }
 
@@ -118,7 +118,7 @@ namespace Grpc.Core
         {
             get
             {
-                Preconditions.CheckState(type == OptionType.Integer);
+                GrpcPreconditions.CheckState(type == OptionType.Integer);
                 return intValue;
             }
         }
@@ -130,7 +130,7 @@ namespace Grpc.Core
         {
             get
             {
-                Preconditions.CheckState(type == OptionType.String);
+                GrpcPreconditions.CheckState(type == OptionType.String);
                 return stringValue;
             }
         }
diff --git a/src/csharp/Grpc.Core/ContextPropagationToken.cs b/src/csharp/Grpc.Core/ContextPropagationToken.cs
index 1d899b97fd..935498246a 100644
--- a/src/csharp/Grpc.Core/ContextPropagationToken.cs
+++ b/src/csharp/Grpc.Core/ContextPropagationToken.cs
@@ -68,7 +68,7 @@ namespace Grpc.Core
 
         internal ContextPropagationToken(CallSafeHandle parentCall, DateTime deadline, CancellationToken cancellationToken, ContextPropagationOptions options)
         {
-            this.parentCall = Preconditions.CheckNotNull(parentCall);
+            this.parentCall = GrpcPreconditions.CheckNotNull(parentCall);
             this.deadline = deadline;
             this.cancellationToken = cancellationToken;
             this.options = options ?? ContextPropagationOptions.Default;
diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj
index 8d7d2cae0d..3189835ccd 100644
--- a/src/csharp/Grpc.Core/Grpc.Core.csproj
+++ b/src/csharp/Grpc.Core/Grpc.Core.csproj
@@ -39,8 +39,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
-    <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
+    <Reference Include="System.Interactive.Async">
       <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath>
     </Reference>
   </ItemGroup>
@@ -91,7 +90,6 @@
     <Compile Include="Internal\AsyncCallBase.cs" />
     <Compile Include="Internal\AsyncCallServer.cs" />
     <Compile Include="Internal\AsyncCall.cs" />
-    <Compile Include="Utils\Preconditions.cs" />
     <Compile Include="Internal\ServerCredentialsSafeHandle.cs" />
     <Compile Include="ServerCredentials.cs" />
     <Compile Include="Metadata.cs" />
@@ -130,6 +128,7 @@
     <Compile Include="Profiling\IProfiler.cs" />
     <Compile Include="Profiling\Profilers.cs" />
     <Compile Include="Internal\DefaultSslRootsOverride.cs" />
+    <Compile Include="Utils\GrpcPreconditions.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="Grpc.Core.nuspec" />
diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs
index f3aa3d79de..86b37b8660 100644
--- a/src/csharp/Grpc.Core/GrpcEnvironment.cs
+++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs
@@ -83,7 +83,7 @@ namespace Grpc.Core
         {
             lock (staticLock)
             {
-                Preconditions.CheckState(refCount > 0);
+                GrpcPreconditions.CheckState(refCount > 0);
                 refCount--;
                 if (refCount == 0)
                 {
@@ -118,7 +118,7 @@ namespace Grpc.Core
         /// </summary>
         public static void SetLogger(ILogger customLogger)
         {
-            Preconditions.CheckNotNull(customLogger, "customLogger");
+            GrpcPreconditions.CheckNotNull(customLogger, "customLogger");
             logger = customLogger;
         }
 
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
index 7dc4490281..2caba260b3 100644
--- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs
+++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
@@ -99,7 +99,7 @@ namespace Grpc.Core.Internal
 
                 lock (myLock)
                 {
-                    Preconditions.CheckState(!started);
+                    GrpcPreconditions.CheckState(!started);
                     started = true;
                     Initialize(cq);
 
@@ -141,7 +141,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!started);
+                GrpcPreconditions.CheckState(!started);
                 started = true;
 
                 Initialize(environment.CompletionQueue);
@@ -168,7 +168,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!started);
+                GrpcPreconditions.CheckState(!started);
                 started = true;
 
                 Initialize(environment.CompletionQueue);
@@ -192,7 +192,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!started);
+                GrpcPreconditions.CheckState(!started);
                 started = true;
 
                 Initialize(environment.CompletionQueue);
@@ -217,7 +217,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!started);
+                GrpcPreconditions.CheckState(!started);
                 started = true;
 
                 Initialize(environment.CompletionQueue);
@@ -257,7 +257,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
+                GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
                 CheckSendingAllowed();
 
                 call.StartSendCloseFromClient(HandleHalfclosed);
@@ -297,7 +297,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(finishedStatus.HasValue, "Status can only be accessed once the call has finished.");
+                GrpcPreconditions.CheckState(finishedStatus.HasValue, "Status can only be accessed once the call has finished.");
                 return finishedStatus.Value.Status;
             }
         }
@@ -310,7 +310,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(finishedStatus.HasValue, "Trailers can only be accessed once the call has finished.");
+                GrpcPreconditions.CheckState(finishedStatus.HasValue, "Trailers can only be accessed once the call has finished.");
                 return finishedStatus.Value.Trailers;
             }
         }
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs
index 81a9a40fcc..45d4c3e078 100644
--- a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs
+++ b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs
@@ -79,9 +79,9 @@ namespace Grpc.Core.Internal
 
         public AsyncCallBase(Func<TWrite, byte[]> serializer, Func<byte[], TRead> deserializer, GrpcEnvironment environment)
         {
-            this.serializer = Preconditions.CheckNotNull(serializer);
-            this.deserializer = Preconditions.CheckNotNull(deserializer);
-            this.environment = Preconditions.CheckNotNull(environment);
+            this.serializer = GrpcPreconditions.CheckNotNull(serializer);
+            this.deserializer = GrpcPreconditions.CheckNotNull(deserializer);
+            this.environment = GrpcPreconditions.CheckNotNull(environment);
         }
 
         /// <summary>
@@ -91,7 +91,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckState(started);
+                GrpcPreconditions.CheckState(started);
                 cancelRequested = true;
 
                 if (!disposed)
@@ -135,7 +135,7 @@ namespace Grpc.Core.Internal
 
             lock (myLock)
             {
-                Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
+                GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
                 CheckSendingAllowed();
 
                 call.StartSendMessage(HandleSendFinished, payload, writeFlags, !initialMetadataSent);
@@ -154,7 +154,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
+                GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
                 CheckReadingAllowed();
 
                 call.StartReceiveMessage(HandleReadFinished);
@@ -204,22 +204,22 @@ namespace Grpc.Core.Internal
 
         protected void CheckSendingAllowed()
         {
-            Preconditions.CheckState(started);
+            GrpcPreconditions.CheckState(started);
             CheckNotCancelled();
-            Preconditions.CheckState(!disposed);
+            GrpcPreconditions.CheckState(!disposed);
 
-            Preconditions.CheckState(!halfcloseRequested, "Already halfclosed.");
-            Preconditions.CheckState(!finished, "Already finished.");
-            Preconditions.CheckState(sendCompletionDelegate == null, "Only one write can be pending at a time");
+            GrpcPreconditions.CheckState(!halfcloseRequested, "Already halfclosed.");
+            GrpcPreconditions.CheckState(!finished, "Already finished.");
+            GrpcPreconditions.CheckState(sendCompletionDelegate == null, "Only one write can be pending at a time");
         }
 
         protected virtual void CheckReadingAllowed()
         {
-            Preconditions.CheckState(started);
-            Preconditions.CheckState(!disposed);
+            GrpcPreconditions.CheckState(started);
+            GrpcPreconditions.CheckState(!disposed);
 
-            Preconditions.CheckState(!readingDone, "Stream has already been closed.");
-            Preconditions.CheckState(readCompletionDelegate == null, "Only one read can be pending at a time");
+            GrpcPreconditions.CheckState(!readingDone, "Stream has already been closed.");
+            GrpcPreconditions.CheckState(readCompletionDelegate == null, "Only one read can be pending at a time");
         }
 
         protected void CheckNotCancelled()
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
index 6752d3fab3..b72cbd795f 100644
--- a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
+++ b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
@@ -53,7 +53,7 @@ namespace Grpc.Core.Internal
 
         public AsyncCallServer(Func<TResponse, byte[]> serializer, Func<byte[], TRequest> deserializer, GrpcEnvironment environment, Server server) : base(serializer, deserializer, environment)
         {
-            this.server = Preconditions.CheckNotNull(server);
+            this.server = GrpcPreconditions.CheckNotNull(server);
         }
 
         public void Initialize(CallSafeHandle call)
@@ -71,7 +71,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckNotNull(call);
+                GrpcPreconditions.CheckNotNull(call);
 
                 started = true;
 
@@ -108,14 +108,14 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckNotNull(headers, "metadata");
-                Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
+                GrpcPreconditions.CheckNotNull(headers, "metadata");
+                GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
 
-                Preconditions.CheckState(!initialMetadataSent, "Response headers can only be sent once per call.");
-                Preconditions.CheckState(streamingWritesCounter == 0, "Response headers can only be sent before the first write starts.");
+                GrpcPreconditions.CheckState(!initialMetadataSent, "Response headers can only be sent once per call.");
+                GrpcPreconditions.CheckState(streamingWritesCounter == 0, "Response headers can only be sent before the first write starts.");
                 CheckSendingAllowed();
 
-                Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
+                GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
 
                 using (var metadataArray = MetadataArraySafeHandle.Create(headers))
                 {
@@ -136,7 +136,7 @@ namespace Grpc.Core.Internal
         {
             lock (myLock)
             {
-                Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
+                GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
                 CheckSendingAllowed();
 
                 using (var metadataArray = MetadataArraySafeHandle.Create(trailers))
@@ -177,7 +177,7 @@ namespace Grpc.Core.Internal
         protected override void CheckReadingAllowed()
         {
             base.CheckReadingAllowed();
-            Preconditions.CheckArgument(!cancelRequested);
+            GrpcPreconditions.CheckArgument(!cancelRequested);
         }
 
         protected override void OnAfterReleaseResources()
diff --git a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
index 9d7a990c42..5c75b52e23 100644
--- a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
+++ b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
@@ -101,7 +101,7 @@ namespace Grpc.Core.Internal
         {
             bool success = false;
             shutdownRefcount.IncrementIfNonzero(ref success);
-            Preconditions.CheckState(success, "Shutdown has already been called");
+            GrpcPreconditions.CheckState(success, "Shutdown has already been called");
         }
 
         private void EndOp()
diff --git a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
index 2796c959a3..628844f242 100644
--- a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
+++ b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
@@ -59,7 +59,7 @@ namespace Grpc.Core.Internal
         public void Register(IntPtr key, OpCompletionDelegate callback)
         {
             environment.DebugStats.PendingBatchCompletions.Increment();
-            Preconditions.CheckState(dict.TryAdd(key, callback));
+            GrpcPreconditions.CheckState(dict.TryAdd(key, callback));
         }
 
         public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback)
@@ -71,7 +71,7 @@ namespace Grpc.Core.Internal
         public OpCompletionDelegate Extract(IntPtr key)
         {
             OpCompletionDelegate value;
-            Preconditions.CheckState(dict.TryRemove(key, out value));
+            GrpcPreconditions.CheckState(dict.TryRemove(key, out value));
             environment.DebugStats.PendingBatchCompletions.Decrement();
             return value;
         }
diff --git a/src/csharp/Grpc.Core/Internal/Enums.cs b/src/csharp/Grpc.Core/Internal/Enums.cs
index b0eab2001b..74f86d2a30 100644
--- a/src/csharp/Grpc.Core/Internal/Enums.cs
+++ b/src/csharp/Grpc.Core/Internal/Enums.cs
@@ -72,7 +72,7 @@ namespace Grpc.Core.Internal
         /// </summary>
         public static void CheckOk(this GRPCCallError callError)
         {
-            Preconditions.CheckState(callError == GRPCCallError.OK, "Call error: " + callError);
+            GrpcPreconditions.CheckState(callError == GRPCCallError.OK, "Call error: " + callError);
         }
     }
 
diff --git a/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs b/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
index 36b865c09c..e810ffcdd0 100644
--- a/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
+++ b/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
@@ -53,7 +53,7 @@ namespace Grpc.Core.Internal
 
         public NativeMetadataCredentialsPlugin(AsyncAuthInterceptor interceptor)
         {
-            this.interceptor = Preconditions.CheckNotNull(interceptor, "interceptor");
+            this.interceptor = GrpcPreconditions.CheckNotNull(interceptor, "interceptor");
             this.nativeInterceptor = NativeMetadataInterceptorHandler;
 
             // Make sure the callback doesn't get garbage collected until it is destroyed.
diff --git a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs
index de66759b94..1f83e51548 100644
--- a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs
+++ b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs
@@ -78,10 +78,10 @@ namespace Grpc.Core.Internal
             var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken);
             try
             {
-                Preconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false));
+                GrpcPreconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false));
                 var request = requestStream.Current;
                 // TODO(jtattermusch): we need to read the full stream so that native callhandle gets deallocated.
-                Preconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false));
+                GrpcPreconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false));
                 var result = await handler(request, context).ConfigureAwait(false);
                 status = context.Status;
                 await responseStream.WriteAsync(result).ConfigureAwait(false);
@@ -134,10 +134,10 @@ namespace Grpc.Core.Internal
             var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken);
             try
             {
-                Preconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false));
+                GrpcPreconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false));
                 var request = requestStream.Current;
                 // TODO(jtattermusch): we need to read the full stream so that native callhandle gets deallocated.
-                Preconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false));
+                GrpcPreconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false));
                 await handler(request, responseStream, context).ConfigureAwait(false);
                 status = context.Status;
             }
diff --git a/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs
index a1d080c7f1..a50f357990 100644
--- a/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs
+++ b/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs
@@ -49,7 +49,7 @@ namespace Grpc.Core.Internal
 
         public static ServerCredentialsSafeHandle CreateSslCredentials(string pemRootCerts, string[] keyCertPairCertChainArray, string[] keyCertPairPrivateKeyArray, bool forceClientAuth)
         {
-            Preconditions.CheckArgument(keyCertPairCertChainArray.Length == keyCertPairPrivateKeyArray.Length);
+            GrpcPreconditions.CheckArgument(keyCertPairCertChainArray.Length == keyCertPairPrivateKeyArray.Length);
             return Native.grpcsharp_ssl_server_credentials_create(pemRootCerts,
                                                                   keyCertPairCertChainArray, keyCertPairPrivateKeyArray,
                                                                   new UIntPtr((ulong)keyCertPairCertChainArray.Length),
diff --git a/src/csharp/Grpc.Core/Internal/Timespec.cs b/src/csharp/Grpc.Core/Internal/Timespec.cs
index 148d877da5..754be4e035 100644
--- a/src/csharp/Grpc.Core/Internal/Timespec.cs
+++ b/src/csharp/Grpc.Core/Internal/Timespec.cs
@@ -141,8 +141,8 @@ namespace Grpc.Core.Internal
         /// </summary>
         public DateTime ToDateTime()
         {
-            Preconditions.CheckState(tv_nsec >= 0 && tv_nsec < NanosPerSecond);
-            Preconditions.CheckState(clock_type == GPRClockType.Realtime);
+            GrpcPreconditions.CheckState(tv_nsec >= 0 && tv_nsec < NanosPerSecond);
+            GrpcPreconditions.CheckState(clock_type == GPRClockType.Realtime);
 
             // fast path for InfFuture
             if (this.Equals(InfFuture))
@@ -195,7 +195,7 @@ namespace Grpc.Core.Internal
                 return Timespec.InfPast;
             }
 
-            Preconditions.CheckArgument(dateTime.Kind == DateTimeKind.Utc, "dateTime needs of kind DateTimeKind.Utc or be equal to DateTime.MaxValue or DateTime.MinValue.");
+            GrpcPreconditions.CheckArgument(dateTime.Kind == DateTimeKind.Utc, "dateTime needs of kind DateTimeKind.Utc or be equal to DateTime.MaxValue or DateTime.MinValue.");
 
             try
             {
diff --git a/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs b/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
index 95a8797e3e..e763c15025 100644
--- a/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
+++ b/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
@@ -65,7 +65,7 @@ namespace Grpc.Core.Internal
 
         public UnmanagedLibrary(string libraryPath)
         {
-            this.libraryPath = Preconditions.CheckNotNull(libraryPath);
+            this.libraryPath = GrpcPreconditions.CheckNotNull(libraryPath);
 
             if (!File.Exists(this.libraryPath))
             {
diff --git a/src/csharp/Grpc.Core/KeyCertificatePair.cs b/src/csharp/Grpc.Core/KeyCertificatePair.cs
index 6f691975e9..a8f3bb073d 100644
--- a/src/csharp/Grpc.Core/KeyCertificatePair.cs
+++ b/src/csharp/Grpc.Core/KeyCertificatePair.cs
@@ -54,8 +54,8 @@ namespace Grpc.Core
         /// <param name="privateKey">PEM encoded private key.</param>
         public KeyCertificatePair(string certificateChain, string privateKey)
         {
-            this.certificateChain = Preconditions.CheckNotNull(certificateChain, "certificateChain");
-            this.privateKey = Preconditions.CheckNotNull(privateKey, "privateKey");
+            this.certificateChain = GrpcPreconditions.CheckNotNull(certificateChain, "certificateChain");
+            this.privateKey = GrpcPreconditions.CheckNotNull(privateKey, "privateKey");
         }
 
         /// <summary>
diff --git a/src/csharp/Grpc.Core/Marshaller.cs b/src/csharp/Grpc.Core/Marshaller.cs
index 3493d2d38f..d86e75b3cb 100644
--- a/src/csharp/Grpc.Core/Marshaller.cs
+++ b/src/csharp/Grpc.Core/Marshaller.cs
@@ -51,8 +51,8 @@ namespace Grpc.Core
         /// <param name="deserializer">Function that will be used to deserialize messages.</param>
         public Marshaller(Func<T, byte[]> serializer, Func<byte[], T> deserializer)
         {
-            this.serializer = Preconditions.CheckNotNull(serializer, "serializer");
-            this.deserializer = Preconditions.CheckNotNull(deserializer, "deserializer");
+            this.serializer = GrpcPreconditions.CheckNotNull(serializer, "serializer");
+            this.deserializer = GrpcPreconditions.CheckNotNull(deserializer, "deserializer");
         }
 
         /// <summary>
diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs
index 21bdf4f114..75e63212b1 100644
--- a/src/csharp/Grpc.Core/Metadata.cs
+++ b/src/csharp/Grpc.Core/Metadata.cs
@@ -179,7 +179,7 @@ namespace Grpc.Core
 
         private void CheckWriteable()
         {
-            Preconditions.CheckState(!readOnly, "Object is read only");
+            GrpcPreconditions.CheckState(!readOnly, "Object is read only");
         }
 
         #endregion
@@ -211,10 +211,10 @@ namespace Grpc.Core
             public Entry(string key, byte[] valueBytes)
             {
                 this.key = NormalizeKey(key);
-                Preconditions.CheckArgument(this.key.EndsWith(BinaryHeaderSuffix),
+                GrpcPreconditions.CheckArgument(this.key.EndsWith(BinaryHeaderSuffix),
                     "Key for binary valued metadata entry needs to have suffix indicating binary value.");
                 this.value = null;
-                Preconditions.CheckNotNull(valueBytes, "valueBytes");
+                GrpcPreconditions.CheckNotNull(valueBytes, "valueBytes");
                 this.valueBytes = new byte[valueBytes.Length];
                 Buffer.BlockCopy(valueBytes, 0, this.valueBytes, 0, valueBytes.Length);  // defensive copy to guarantee immutability
             }
@@ -227,9 +227,9 @@ namespace Grpc.Core
             public Entry(string key, string value)
             {
                 this.key = NormalizeKey(key);
-                Preconditions.CheckArgument(!this.key.EndsWith(BinaryHeaderSuffix),
+                GrpcPreconditions.CheckArgument(!this.key.EndsWith(BinaryHeaderSuffix),
                     "Key for ASCII valued metadata entry cannot have suffix indicating binary value.");
-                this.value = Preconditions.CheckNotNull(value, "value");
+                this.value = GrpcPreconditions.CheckNotNull(value, "value");
                 this.valueBytes = null;
             }
 
@@ -270,7 +270,7 @@ namespace Grpc.Core
             {
                 get
                 {
-                    Preconditions.CheckState(!IsBinary, "Cannot access string value of a binary metadata entry");
+                    GrpcPreconditions.CheckState(!IsBinary, "Cannot access string value of a binary metadata entry");
                     return value ?? Encoding.GetString(valueBytes);
                 }
             }
@@ -323,8 +323,8 @@ namespace Grpc.Core
 
             private static string NormalizeKey(string key)
             {
-                var normalized = Preconditions.CheckNotNull(key, "key").ToLower(CultureInfo.InvariantCulture);
-                Preconditions.CheckArgument(ValidKeyRegex.IsMatch(normalized), 
+                var normalized = GrpcPreconditions.CheckNotNull(key, "key").ToLower(CultureInfo.InvariantCulture);
+                GrpcPreconditions.CheckArgument(ValidKeyRegex.IsMatch(normalized), 
                     "Metadata entry key not valid. Keys can only contain lowercase alphanumeric characters, underscores and hyphens.");
                 return normalized;
             }
diff --git a/src/csharp/Grpc.Core/Method.cs b/src/csharp/Grpc.Core/Method.cs
index 99162a7d5d..0cf041be2b 100644
--- a/src/csharp/Grpc.Core/Method.cs
+++ b/src/csharp/Grpc.Core/Method.cs
@@ -106,10 +106,10 @@ namespace Grpc.Core
         public Method(MethodType type, string serviceName, string name, Marshaller<TRequest> requestMarshaller, Marshaller<TResponse> responseMarshaller)
         {
             this.type = type;
-            this.serviceName = Preconditions.CheckNotNull(serviceName, "serviceName");
-            this.name = Preconditions.CheckNotNull(name, "name");
-            this.requestMarshaller = Preconditions.CheckNotNull(requestMarshaller, "requestMarshaller");
-            this.responseMarshaller = Preconditions.CheckNotNull(responseMarshaller, "responseMarshaller");
+            this.serviceName = GrpcPreconditions.CheckNotNull(serviceName, "serviceName");
+            this.name = GrpcPreconditions.CheckNotNull(name, "name");
+            this.requestMarshaller = GrpcPreconditions.CheckNotNull(requestMarshaller, "requestMarshaller");
+            this.responseMarshaller = GrpcPreconditions.CheckNotNull(responseMarshaller, "responseMarshaller");
             this.fullName = GetFullName(serviceName, name);
         }
 
diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs
index d120f95fdf..5b61b7f060 100644
--- a/src/csharp/Grpc.Core/Server.cs
+++ b/src/csharp/Grpc.Core/Server.cs
@@ -125,7 +125,7 @@ namespace Grpc.Core
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!startRequested);
+                GrpcPreconditions.CheckState(!startRequested);
                 startRequested = true;
                 
                 handle.Start();
@@ -142,8 +142,8 @@ namespace Grpc.Core
         {
             lock (myLock)
             {
-                Preconditions.CheckState(startRequested);
-                Preconditions.CheckState(!shutdownRequested);
+                GrpcPreconditions.CheckState(startRequested);
+                GrpcPreconditions.CheckState(!shutdownRequested);
                 shutdownRequested = true;
             }
 
@@ -162,8 +162,8 @@ namespace Grpc.Core
         {
             lock (myLock)
             {
-                Preconditions.CheckState(startRequested);
-                Preconditions.CheckState(!shutdownRequested);
+                GrpcPreconditions.CheckState(startRequested);
+                GrpcPreconditions.CheckState(!shutdownRequested);
                 shutdownRequested = true;
             }
 
@@ -181,7 +181,7 @@ namespace Grpc.Core
 
             bool success = false;
             handle.DangerousAddRef(ref success);
-            Preconditions.CheckState(success);
+            GrpcPreconditions.CheckState(success);
         }
 
         internal void RemoveCallReference(object call)
@@ -197,7 +197,7 @@ namespace Grpc.Core
         {
             lock (myLock)
             {
-                Preconditions.CheckState(!startRequested);
+                GrpcPreconditions.CheckState(!startRequested);
                 foreach (var entry in serviceDefinition.CallHandlers)
                 {
                     callHandlers.Add(entry.Key, entry.Value);
@@ -213,8 +213,8 @@ namespace Grpc.Core
         {
             lock (myLock)
             {
-                Preconditions.CheckNotNull(serverPort.Credentials, "serverPort");
-                Preconditions.CheckState(!startRequested);
+                GrpcPreconditions.CheckNotNull(serverPort.Credentials, "serverPort");
+                GrpcPreconditions.CheckState(!startRequested);
                 var address = string.Format("{0}:{1}", serverPort.Host, serverPort.Port);
                 int boundPort;
                 using (var nativeCredentials = serverPort.Credentials.ToNativeCredentials())
diff --git a/src/csharp/Grpc.Core/ServerCredentials.cs b/src/csharp/Grpc.Core/ServerCredentials.cs
index 3c6703d30e..ace4820027 100644
--- a/src/csharp/Grpc.Core/ServerCredentials.cs
+++ b/src/csharp/Grpc.Core/ServerCredentials.cs
@@ -90,11 +90,11 @@ namespace Grpc.Core
         public SslServerCredentials(IEnumerable<KeyCertificatePair> keyCertificatePairs, string rootCertificates, bool forceClientAuth)
         {
             this.keyCertificatePairs = new List<KeyCertificatePair>(keyCertificatePairs).AsReadOnly();
-            Preconditions.CheckArgument(this.keyCertificatePairs.Count > 0,
+            GrpcPreconditions.CheckArgument(this.keyCertificatePairs.Count > 0,
                 "At least one KeyCertificatePair needs to be provided.");
             if (forceClientAuth)
             {
-                Preconditions.CheckNotNull(rootCertificates,
+                GrpcPreconditions.CheckNotNull(rootCertificates,
                     "Cannot force client authentication unless you provide rootCertificates.");
             }
             this.rootCertificates = rootCertificates;
diff --git a/src/csharp/Grpc.Core/ServerPort.cs b/src/csharp/Grpc.Core/ServerPort.cs
index 598404d045..afae0846dd 100644
--- a/src/csharp/Grpc.Core/ServerPort.cs
+++ b/src/csharp/Grpc.Core/ServerPort.cs
@@ -62,9 +62,9 @@ namespace Grpc.Core
         /// <param name="credentials">credentials to use to secure this port.</param>
         public ServerPort(string host, int port, ServerCredentials credentials)
         {
-            this.host = Preconditions.CheckNotNull(host, "host");
+            this.host = GrpcPreconditions.CheckNotNull(host, "host");
             this.port = port;
-            this.credentials = Preconditions.CheckNotNull(credentials, "credentials");
+            this.credentials = GrpcPreconditions.CheckNotNull(credentials, "credentials");
         }
 
         /// <summary>
diff --git a/src/csharp/Grpc.Core/Utils/Preconditions.cs b/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs
similarity index 99%
rename from src/csharp/Grpc.Core/Utils/Preconditions.cs
rename to src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs
index a8ab603391..fcfe97a09b 100644
--- a/src/csharp/Grpc.Core/Utils/Preconditions.cs
+++ b/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs
@@ -38,7 +38,7 @@ namespace Grpc.Core.Utils
     /// <summary>
     /// Utility methods to simplify checking preconditions in the code.
     /// </summary>
-    public static class Preconditions
+    public static class GrpcPreconditions
     {
         /// <summary>
         /// Throws <see cref="ArgumentException"/> if condition is false.
diff --git a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs
index 26c6445c35..0de9d3b61f 100644
--- a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs
+++ b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs
@@ -127,8 +127,8 @@ namespace Grpc.HealthCheck
         {
             public Key(string host, string service)
             {
-                this.Host = Preconditions.CheckNotNull(host);
-                this.Service = Preconditions.CheckNotNull(service);
+                this.Host = GrpcPreconditions.CheckNotNull(host);
+                this.Service = GrpcPreconditions.CheckNotNull(service);
             }
 
             readonly string Host;
diff --git a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
index e9e659cb1f..5e91d4a96c 100644
--- a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
+++ b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
@@ -58,7 +58,7 @@ namespace Grpc.IntegrationTesting
         public static IClientRunner CreateStarted(ClientConfig config)
         {
             string target = config.ServerTargets.Single();
-            Grpc.Core.Utils.Preconditions.CheckArgument(config.LoadParams.LoadCase == LoadParams.LoadOneofCase.ClosedLoop);
+            GrpcPreconditions.CheckArgument(config.LoadParams.LoadCase == LoadParams.LoadOneofCase.ClosedLoop);
 
             var credentials = config.SecurityParams != null ? TestCredentials.CreateSslCredentials() : ChannelCredentials.Insecure;
             var channel = new Channel(target, credentials);
@@ -95,7 +95,7 @@ namespace Grpc.IntegrationTesting
         
         public SyncUnaryClientRunner(Channel channel, int payloadSize, HistogramParams histogramParams)
         {
-            this.channel = Grpc.Core.Utils.Preconditions.CheckNotNull(channel);
+            this.channel = GrpcPreconditions.CheckNotNull(channel);
             this.payloadSize = payloadSize;
             this.histogram = new Histogram(histogramParams.Resolution, histogramParams.MaxPossible);
 
diff --git a/src/csharp/Grpc.IntegrationTesting/Histogram.cs b/src/csharp/Grpc.IntegrationTesting/Histogram.cs
index 7e7cb2c4de..28d1f078a9 100644
--- a/src/csharp/Grpc.IntegrationTesting/Histogram.cs
+++ b/src/csharp/Grpc.IntegrationTesting/Histogram.cs
@@ -66,8 +66,8 @@ namespace Grpc.IntegrationTesting
 
         public Histogram(double resolution, double maxPossible)
         {
-            Grpc.Core.Utils.Preconditions.CheckArgument(resolution > 0);
-            Grpc.Core.Utils.Preconditions.CheckArgument(maxPossible > 0);
+            GrpcPreconditions.CheckArgument(resolution > 0);
+            GrpcPreconditions.CheckArgument(maxPossible > 0);
             this.maxPossible = maxPossible;
             this.multiplier = 1.0 + resolution;
             this.oneOnLogMultiplier = 1.0 / Math.Log(1.0 + resolution);
diff --git a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs
index e8be7758ce..b89a5d329c 100644
--- a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs
+++ b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs
@@ -57,7 +57,7 @@ namespace Grpc.IntegrationTesting
         /// </summary>
         public static IServerRunner CreateStarted(ServerConfig config)
         {
-            Grpc.Core.Utils.Preconditions.CheckArgument(config.ServerType == ServerType.ASYNC_SERVER);
+            GrpcPreconditions.CheckArgument(config.ServerType == ServerType.ASYNC_SERVER);
             var credentials = config.SecurityParams != null ? TestCredentials.CreateSslServerCredentials() : ServerCredentials.Insecure;
 
             // TODO: qps_driver needs to setup payload properly...
@@ -83,7 +83,7 @@ namespace Grpc.IntegrationTesting
 
         public ServerRunnerImpl(Server server)
         {
-            this.server = Grpc.Core.Utils.Preconditions.CheckNotNull(server);
+            this.server = GrpcPreconditions.CheckNotNull(server);
         }
 
         public int BoundPort
diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
index bb2918bf46..b9c68ece2a 100644
--- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
+++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
@@ -49,7 +49,7 @@ namespace Grpc.Testing
     {
         public async Task RunServer(IAsyncStreamReader<ServerArgs> requestStream, IServerStreamWriter<ServerStatus> responseStream, ServerCallContext context)
         {
-            Grpc.Core.Utils.Preconditions.CheckState(await requestStream.MoveNext());
+            GrpcPreconditions.CheckState(await requestStream.MoveNext());
             var serverConfig = requestStream.Current.Setup;
             var runner = ServerRunners.CreateStarted(serverConfig);
 
@@ -73,7 +73,7 @@ namespace Grpc.Testing
 
         public async Task RunClient(IAsyncStreamReader<ClientArgs> requestStream, IServerStreamWriter<ClientStatus> responseStream, ServerCallContext context)
         {
-            Grpc.Core.Utils.Preconditions.CheckState(await requestStream.MoveNext());
+            GrpcPreconditions.CheckState(await requestStream.MoveNext());
             var clientConfig = requestStream.Current.Setup;
             var runner = ClientRunners.CreateStarted(clientConfig);
 
-- 
GitLab