diff --git a/Build.props b/Build.props
index 4db02f66..ebefaaf9 100644
--- a/Build.props
+++ b/Build.props
@@ -1,6 +1,6 @@
- 0.1.10
+ 0.1.11
\ No newline at end of file
diff --git a/CredentialProvider.Microsoft/CredentialProviders/Vsts/VstsCredentialProvider.cs b/CredentialProvider.Microsoft/CredentialProviders/Vsts/VstsCredentialProvider.cs
index 51850c5b..2b35dfc6 100644
--- a/CredentialProvider.Microsoft/CredentialProviders/Vsts/VstsCredentialProvider.cs
+++ b/CredentialProvider.Microsoft/CredentialProviders/Vsts/VstsCredentialProvider.cs
@@ -37,6 +37,18 @@ public VstsCredentialProvider(
public override async Task CanProvideCredentialsAsync(Uri uri)
{
+ // If for any reason we reach this point and any of the three build task env vars are set,
+ // we should not try get credentials with this cred provider.
+ string feedEndPointsJsonEnvVar = Environment.GetEnvironmentVariable(EnvUtil.BuildTaskExternalEndpoints);
+ string uriPrefixesStringEnvVar = Environment.GetEnvironmentVariable(EnvUtil.BuildTaskUriPrefixes);
+ string accessTokenEnvVar = Environment.GetEnvironmentVariable(EnvUtil.BuildTaskAccessToken);
+
+ if (string.IsNullOrWhiteSpace(feedEndPointsJsonEnvVar) == false || string.IsNullOrWhiteSpace(uriPrefixesStringEnvVar) == false || string.IsNullOrWhiteSpace(accessTokenEnvVar) == false)
+ {
+ Verbose(Resources.BuildTaskCredProviderIsUsedError);
+ return false;
+ }
+
var validHosts = EnvUtil.GetHostsFromEnvironment(Logger, EnvUtil.SupportedHostsEnvVar, new[]
{
".pkgs.vsts.me", // DevFabric
diff --git a/CredentialProvider.Microsoft/RequestHandlers/RequestHandlerBase.cs b/CredentialProvider.Microsoft/RequestHandlers/RequestHandlerBase.cs
index 42bde0f2..48479640 100644
--- a/CredentialProvider.Microsoft/RequestHandlers/RequestHandlerBase.cs
+++ b/CredentialProvider.Microsoft/RequestHandlers/RequestHandlerBase.cs
@@ -68,6 +68,8 @@ public async Task HandleResponseAsync(IConnection connection, Message message, I
var cancelMessage = MessageUtilities.Create(message.RequestId, MessageType.Cancel, message.Method);
await connection.SendAsync(cancelMessage, CancellationToken.None);
+ Logger.Verbose(ex.ToString());
+
// We must guarantee that exactly one terminating message is sent, so do not fall through to send
// the normal response, but also do not rethrow.
return;
@@ -89,7 +91,7 @@ bool LogExceptionAndReturnFalse(Exception ex)
}
Logger.Verbose(string.Format(Resources.ResponseHandlerException, message.Method, message.RequestId));
- Logger.Error(ex.ToString());
+ Logger.Verbose(ex.ToString());
return false;
}