The problem (C# compiler warning message):
warning CS0467: Ambiguity between method 'Microsoft.Office.Interop.Word._Document.close(ref object, ref object, ref object)' and non-method 'Microsoft.Office.Interop.Word.DocumentEvents2_Event.Close'. Using method group.
The (partial..) solution: Compile time warning when using 'Microsoft.Office.Interop.Word._Document.Close'
The dilemma:
If I explicitly cast to Microsoft.Office.Interop.Word._Document, ReSharper warns me that the "Type cast is redundant"
The question: Is there a real solution for this warning message, not just patchwork?
Just don't cast, C# doesn't require it:
Word._Application app = new Word.Application();
Word._Document doc = app.Documents.Add(...);
doc.Close(...); // No ambiguity
app.Quit(...);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With