Add-In and ADO.NET Entity Framework - ArcMap Crashes

3419
1
09-05-2012 01:13 PM
MattNicol
New Contributor III
I'm working on an ArcMap Add-In project using the .NET Framework 3.5 and targeting ArcMap 10.0.

I'd like to use the ADO.NET Entity Framework using a database-first strategy.  However, when debugging, ArcMap crashes at the constructor when the base constructor is called as highlighted below.

public Entities() : 
     base("name=Entities", "Entities"){
            this.OnContextCreated();
}


If I set up my .edmx file in the same way in a Windows Forms project, the constructor works fine, so I'm thinking that it's something specfic to add-in projects.

Any ideas?
0 Kudos
1 Reply
RichardWatson
Frequent Contributor
It would be helpful to see what exception is causing ArcMap to crash.  You can use Visual Studio to run ArcMap and can catch these exceptions in order to view them.  Just break in the debugger before the crash and tell Visual Studio to stop when an exception is thrown.  Note that you can get false positives so leaving this on will get very confusing.

I have not used add-in's but perhaps the problem lies in ArcMap finding assemblies that your add-in references?  Just a guess.
0 Kudos