Unknown Exception During Build

182 views Asked by At

I'm getting an unexpected error when I (re)build the main project of my solution:

"Exception has been thrown by the target of an invocation." D:\MyApp\Db\Model.edmx

Db is a supporting project referenced by the main project. I created the .EDMX with a Model-First design.

I've looked at the detailed build output, but nothing is apparent as to what the cause and/or source of this is. There's no apparent way to find out what the exception actually is.

Nor does Google return anything for this error in the context of an .EDMX file.

How to go about finding out what's causing this, so I can fix it?

EDIT #1: I also get the error as a single MessageBox when I try to open the .EDMX for editing in Visual Studio. There's no hint about what the exception may be, nor where I might find more detail.

EDIT #2: I've been able to narrow it down to one of these four assemblies:

  • Db.dll (the project assembly)
  • EntityFramework.dll
  • EntityFramework.SqIServer.dll
  • EntityFramework.SqIServerCompact.dll

If I delete any one of the four in the project's \bin folder, I can open the .EDMX for editing.

Does anyone know how to trap the exception that's occurring, so I can go about fixing it?

1

There are 1 answers

0
InteXX On BEST ANSWER

I found the source of the exception—it's the SqlServerCe provider (or its configuration) that's installed by SQL Server CE & SQLite ToolBox. When I change the provider to SqlClient the exception disappears.

This is not impugn this excellent tool—there just appears to be a conflict between its latest version and VS2013.4.

EDIT:

I'm pleased to be able to retract my report; the problem didn't lie within the extension's scope.

The problem was that I hadn't installed the EF Tools for Visual Studio nor registered the DDEX provider. Details here.