0

We're building a .NET 4 WPF application that runs from a network drive. The application starts fine for me and most of my (developer) peers. Recently, a software tester has joined our development team and was put in the same AD groups as I'm in.

Whenever he launches the application, this dialog pops up:

Error dialog and the app naturally crashes after that.

When attaching a debugger, the debugger breaks at the first line of EF 4.4's DbContext constructor, for which the code is as follows:

public class CardioDanosContext : DbContext
{
    // ...
    public CardioDanosContext()
        : base("CardioDanos")
    {
        // Irrelevant first line

As you can see, we call the DbContext's constructor with a connection string name which is defined in our app.config like so:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- ... -->
  </configSections>

  <runtime>
    <loadFromRemoteSources enabled="true"/>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="External;Resources;Base;Services;Modules;Data;"/>
    </assemblyBinding>
  </runtime>

  <connectionStrings>
    <add name="CardioDanos"
         connectionString="Data Source={snip};Initial Catalog=CardioDanos;Integrated Security=True;"
         providerName="System.Data.SqlClient"/>
  </connectionStrings>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

  <appSettings>
    <!-- ... -->
  </appSettings>

  <!-- ... -->

</configuration>

Now, I'm assuming it is an issue with permissions, but we've verified all permissions for the affected user and they all seem in order. He can read and modify the app.config file without problems. I also assume it has something to do with running it from a network drive, but then again, it works fine for some of us.

I've not really found anything about this while searching the Internet, but does anyone have a clue why this could be happening?

MLowijs
  • 1,485
  • 2
  • 11
  • 16

1 Answers1

0

Some googling tells me that some assemblies cannot be loaded. Are you sure that everything is correctly installed on the client? Any third party assemblies you are using that are installed in the GAC on your development machines, which are missing on the clients machine?

How are you deploying the application? Are you creating a publish, or are you just copying the bin/debug folder? If the last, then you are not including any specific referenced assemblies if you have not set 'Copy local' to True.

How is Entity Framework referenced? Are you using a NuGet package, or an old install which you have done manually?

Community
  • 1
  • 1
Maarten
  • 22,527
  • 3
  • 47
  • 68
  • Those links' errors seem to explicitly mention that an assembly can't be found, while this one doesn't. We're not using any 3rd party assemblies that require installation, they are all post-build copied into a folder called 'External' that we scan by means of assembly binding/probing. EF is installed into the solution as a NuGet package. The application is deployed onto the network share by our build server copying the bin/Release folder over. – MLowijs Oct 28 '13 at 16:59
  • If you check at Solution Explorer -> Project -> Right click -> Choose Properties -> Publish -> Application Files, then do you see any DLL files that you have not in your deployment? – Maarten Oct 28 '13 at 17:03
  • And can you post your complete app.config? Or at least the section that EF added? – Maarten Oct 28 '13 at 17:04
  • No, all the referenced DLLS seem to be there. EF didn't really add anything to our app.config, since we're using POCO and had to add the connection string manually. I'll post the relevant bits of our app.config though. – MLowijs Oct 28 '13 at 17:16
  • The stack trace of the exception screenshot shows it is trying to read a config section. – Maarten Oct 28 '13 at 17:22