Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlDependency.Start throws FileNotFoundException #260

Closed
Grauenwolf opened this issue Oct 12, 2019 · 2 comments
Closed

SqlDependency.Start throws FileNotFoundException #260

Grauenwolf opened this issue Oct 12, 2019 · 2 comments
Assignees
Labels
🐛 Bug! Issues that are bugs in the drivers we maintain.

Comments

@Grauenwolf
Copy link

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.

@cheenamalhotra
Copy link
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.

@David-Engel David-Engel added this to the 1.1.0 milestone Oct 24, 2019
@David-Engel David-Engel added the 🐛 Bug! Issues that are bugs in the drivers we maintain. label Oct 24, 2019
@David-Engel
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug! Issues that are bugs in the drivers we maintain.
Projects
None yet
Development

No branches or pull requests

3 participants