Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to run unit tests against ArcMap extension which closely coupled with specific edit workspace and map state. When I try to initialize ArcMap 10 application with code like this:

IDocument pdoc = new MxDocumentClass();
_application = pdoc.Parent;

I receive error "The runtime application type must be specified before license initialization". Is there any workaround or better way for unit testing?

share|improve this question
Just curious, are you using a unit testing framework and if so which one? Are you mocking ArcObjects? – blah238 May 1 '12 at 22:05
Using standard VS2010 testing framework. I'm not mocking AO, using ArcMap automation & PGDB. Later in my project, I plan to fascade AO with custom abstract API based on OGC Simple Feature. Then it will be more realistic to use mocking. – megadrofan May 1 '12 at 22:50

Adding this line fixes the issue

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.