NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.
MIT License
696 stars 143 forks source link

RhinoMocks causes Failed to create Exception Message. #429

Closed timsteen closed 4 hours ago

timsteen commented 1 month ago

Example:

Word.Document docMoc = Rhino.Mocks.MockRepository.GenerateStub(); docMoc.Stub(d => d.Creator).Return(4711);

throws:

NetOffice.Exceptions.PropertyGetCOMException: '<Failed to create Exception Message. Please report this bug.>' InnerException InvalidOperationException: Previous method 'Type.get_Namespace();' requires a return value or an exception to throw.

I am migrating code from Word.Interop where I am using RhinoMocks. I also tried Moq but that also did not work (other errors).

Perhaps you can recommend a mocking framework that can be used together with NetOfficeFw?

jozefizso commented 1 month ago

You must consult the documentation for respective mocking libraries to use the correctly.