Skip to content

Commit

Permalink
Fix issue (dotnet#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
Davoud Eshtehari authored and Davoud Eshtehari committed Feb 10, 2020
1 parent 031ad51 commit a696100
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ internal static int SniMaxComposedSpnLength

static AppDomain GetDefaultAppDomainInternal()
{
var host = new mscoree.CorRuntimeHost();
host.GetDefaultDomain(out object temp);
AppDomain defaultAppDomain = temp as AppDomain;
return defaultAppDomain;
return AppDomain.CurrentDomain;
}

internal static _AppDomain GetDefaultAppDomain()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<Compile Include="SQL\SqlBulkCopyTest\CopyWidenNullInexactNumerics.cs" />
<Compile Include="SQL\SqlCommand\SqlCommandSetTest.cs" />
<Compile Include="SQL\SqlCredentialTest\SqlCredentialTest.cs" />
<Compile Include="SQL\SqlDependencyTest\SqlDependencyTest.cs" />
<Compile Include="SQL\SqlSchemaInfoTest\SqlSchemaInfoTest.cs" />
<Compile Include="SQL\SqlStatisticsTest\SqlStatisticsTest.cs" />
<Compile Include="SQL\SqlBulkCopyTest\AdjustPrecScaleForBulkCopy.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Xunit;

namespace Microsoft.Data.SqlClient.ManualTesting.Tests
{
public class SqlDependencyTest
{
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureServer))]
public void SqlDependencyStartStopTest()
{
try
{
SqlDependency.Start(DataTestUtility.TCPConnectionString);
SqlDependency.Stop(DataTestUtility.TCPConnectionString);
}
catch (Exception e)
{
Assert.True(false, e.Message);
}
}
}
}

0 comments on commit a696100

Please sign in to comment.