Shadow-copying a dynamically-loaded assembly

I have a query connected to an EntityFramework DbContext connection with a custom entity model assembly and config file.

The build output for the entity model assembly includes EntityFramework.dll and EntityFramework.SqlServer.dll. The latter does is not statically referenced by EntityFramework, however it is required by the config file, which includes:

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
It appears that LinqPad 5 is shadow copying my entity model assembly and EntityFramework.dll, but is not shadow copying EntityFramework.SqlServer.dll and is accessing the copy in the original folder, which is blocking me from updating it.

Could LinqPad be made to shadow copy EntityFramework.SqlServer.dll too?

Comments

  • I'll special-case the EntityFramework.SqlServer.dll assembly for the next build. In the meantime, you can work around this by explicitly referencing that assembly in your queries.
  • Excellent, thanks!

    FWIW my current work-around is on the deployment side - when updating my binaries I rename EntityFramework.SqlServer.dll before deleting it. That way the zombie file - still in use by LinqPad - doesn't get in the way of the new copy.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!