Warning CS0467 when using 'Microsoft.Office.Interop.Word._Document.Close'
c#, compiler-warnings
Solution
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(...);
Problem
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?