Skip to content

SqlDependency.Start throws FileNotFoundException #260

Description

@Grauenwolf

Describe the bug

When running against .NET Framework 4.6.1, SqlDependency.Start(string) throws a FileNotFoundException.

Exception message:
        System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.SqlClient, Version=1.0.19269.1, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5' or one of its dependencies. The system cannot find the file specified.

Stack trace:
        RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
        RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
        RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
        Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
        Activator.CreateInstance(String assemblyName, String typeName)
        AppDomain.CreateInstance(String assemblyName, String typeName)
        StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
        StackBuilderSink.SyncProcessMessage(IMessage msg)
        Exception rethrown at [0]: 
        RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
        RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
        _AppDomain.CreateInstance(String assemblyName, String typeName)
        SqlDependency.CreateProcessDispatcher(_AppDomain masterDomain)
        SqlDependency.ObtainProcessDispatcher()
        SqlDependency.Start(String connectionString, String queue, Boolean useDefaults)
        SqlDependency.Start(String connectionString)

Further technical details

<PackageReference Include="Microsoft.Data.SqlClient" Version="1.0.19269.1" />

Additional context
The same code works correctly when targeting .NET Core 2.1.

The same code works correctly when using System.Data.SqlClient against .NET Framework 4.6.1.

Activity

  1. cheenamalhotra commented on Oct 16, 2019

    @cheenamalhotra
    Member

    Hi @Grauenwolf

    I'm able to reproduce issue as well. The internal error is

    image

    We'll investigate more on this but seems to be an issue with Bid porting activities.

    @saurabh500 do you have clues to why this issue happens only in Microsoft.Data.SqlClient NetFx? System.Data.SqlClient NetFx seems to work normally.

  2. added this to the 1.1.0 milestone on Oct 24, 2019
  3. David-Engel commented on Oct 24, 2019

    @David-Engel
    Contributor

    This is fixed and will be reflected in the next 1.1.0 preview and GA release.

  4. changed the title [-]SqlDependency.Start fails for .NET 4.6.1[/-] [+]SqlDependency.Start throws FileNotFoundException[/+] on Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions