Build/Test Issues

Entity Framework metadata problem using console tool

Started by dpc640 on 7,074 views

Hello,

I have a solution with over thirty projects, including a DBModel project and a project that only runs tests which require an actual database connection. When run from my development machine, the console tool works perfectly.

When running from an NCrunch grid server, I get:

 System.Data.Entity.Core.MetadataException : Unable to load the specified metadata resource


The metadata is included in resources in the DBModel.dll, and we have no problems when running from other non-development systems. Including running from the same server as a grid node.

Any ideas?

Thanks,

Patrick
Hi Patrick,

Is it possible that the DBModel.dll is included in the GAC on the client machine, or somehow being referenced in a global manner? (i.e. by absolute path) If so, this would cause problems for finding the file on the grid node.

Would you be able to inspect the workspace created on the grid node to see how the code is being arranged and how this DLL is being referenced? You can do this by through the following steps:

1. Set up a network share pointing to the workspace base path on the grid node server (read-only is fine)
2. In the grid node configuration tool, set the 'Workspace base path over network share' to consider the network share name
3. Turn off local processing in the distributed processing window
4. Turn on processing for the grid server only
5. Re-run the test and wait until it fails
6. Right-click the failed test, choose Advanced->Browse to workspace

This will allow you to inspect the contents of the workspace built on the grid node server. Of particular interest is the manner in which the test project is referencing the DBModel project inside its project file. How is this being done? Is this correctly pointing to another workspace with the DLL file sitting in its build output directory?
Ok, great call, that pointed out a problem. If I look at the dll built from studio, the entity framework artifacts are included as resources. Looking at the dll in the NCrunch workspace, they are not included. Any ideas why that might be?

Thanks,

Patrick

Hi Patrick,

That is of great interest. Does NCrunch give you any warnings about missing SDKs or build targets on the grid node? My first guess here would be that this behaviour requires an SDK to be installed on the machine, which may not exist on the grid node.
Remco,

I didn't see any SDK warnings, but I reinstalled and updated Visual Studio on my build machine, and that took care of the problem.

Thanks for your help!

Patrick

Post a reply

Log in to reply.