RaYell
RaYell

Reputation: 70444

Visual Studio error while creating Unit Tests

I want to create unit tests for one of my project's classes but I'm getting a following error when I right click on the class source code and choose Create Unit Tests button:

The following error was encountered while reading module 'Microsoft.Office.Tools.Common.v9.0': Could not resolve type reference: [office]Microsoft.Office.Core.IRibbonExtensibility.

My project is an Outlook add-in and everything compiles correctly. Does anyone have any suggestion what this error might be and how could I avoid it?

Edit

After following suggestions from Ruffles' answer the error has changed to:

The following error was encountered while reading module 'Microsoft.Office.Tools.Outlook.v9.0': Could not resolve type reference: [Microsoft.Office.Interop.Outlook]Microsoft.Office.Core.FormRegionStartup.

Upvotes: 0

Views: 1038

Answers (3)

Yaroslav Yakovlev
Yaroslav Yakovlev

Reputation: 6483

Actually if all you need is test your class, you should just create an empty test. And fill it with testing cases you need. The only thing you'll get from adding it with add test for this class is some generated test cases that you'll remove anyway. And if I got it right the goal is to write unit tests, not to be able to create unit test by clicking on them with right mouse button :-).

Upvotes: 2

Ruffles
Ruffles

Reputation: 79

That sounds a lot like the issue described here:

http://social.msdn.microsoft.com/forums/en-US/vsto/thread/064ab7fd-a397-46ae-be84-192acc394a29

Is it worth trying the suggestions listed there?

Upvotes: 1

Pete OHanlon
Pete OHanlon

Reputation: 9146

Have a read of this thread - there's a fair bit of information that you may need.

Upvotes: 1

Related Questions