Skip to content

Commit

Permalink
Disabled AppContext's switch catching
Browse files Browse the repository at this point in the history
  • Loading branch information
Davoud Eshtehari authored and Davoud Eshtehari committed Apr 1, 2020
1 parent 7239dd8 commit bb87b19
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BUILDGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ Managed SNI can be enabled on Windows by enabling the below AppContext switch:

Scaled decimal parameter truncation can be enabled by enabling the below AppContext switch:

**"Microsoft.Data.SqlClient.TruncateScaledDecimal"**
**"Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal"**
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ static DataTestUtility()
Console.WriteLine($"App Context switch {ManagedNetworkingAppContextSwitch} enabled on {Environment.OSVersion}");
}

AppContext.SetSwitch("TestSwitch.LocalAppContext.DisableCaching", true); //disable caching on LocalAppContext for defined switches

using (StreamReader r = new StreamReader("config.json"))
{
string json = r.ReadToEnd();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,6 @@ private static bool ValidateInsertedValues(SqlConnection connection, string tabl

public class ConnectionStringsProvider : IEnumerable<object[]>
{
public ConnectionStringsProvider()
{
AppContext.SetSwitch(@"TestSwitch.LocalAppContext.DisableCaching", true); //disable appContext's switches
}
public IEnumerator<object[]> GetEnumerator()
{
if (!string.IsNullOrEmpty(DataTestUtility.TCPConnectionString))
Expand Down

0 comments on commit bb87b19

Please sign in to comment.