[英]Error in once functioning C# project - no suitable method found to override
In short, I'm building an addin for Outlook in C#
and I've ran into a bit of a panic-situation. 简而言之,我正在使用
C#
构建Outlook的插件,但遇到了一些恐慌的情况。 Please forgive if some of the information I provided is not relevant to solving my problem, but I cannot diagnose where this issue came from or why. 如果我提供的某些信息与解决我的问题无关,请原谅,但我无法诊断出此问题的来源或原因。
My problem is as follow: At an early part of my code, I have... 我的问题如下:在代码的早期,我有...
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
return new Ribbon1();
}
The problem is that now, all of a sudden, I get: 问题是,现在我突然得到:
Error 1 'asd.ThisAddIn.CreateRibbonExtensibilityObject()': no suitable method found to override
错误1'asd.ThisAddIn.CreateRibbonExtensibilityObject()':找不到合适的方法来覆盖
( asd
is just the namespace I'm using) (
asd
只是我正在使用的名称空间)
Up until now, I was essentially done, and decided to start my construction on another project. 到目前为止,我基本上已经完成了工作,并决定开始在另一个项目上进行构建。
Upon returning to my Outlook addin, I find this and other errors such as: 返回我的Outlook加载项后,我发现此错误和其他错误,例如:
Error 2 The name 'Properties' does not exist in the current context
错误2名称“属性”在当前上下文中不存在
What could possibly have happened? 可能会发生什么?
Like I said, I left this project essentially done, and came back to nothing working. 就像我说的那样,我基本上没有完成这个项目,后来又无济于事。
Please, I'm really desperate here, as I can't see what the problem is. 拜托,我真的很在这里,因为我看不出问题出在哪里。
Right, it might not be a very technical answer, but the following is what I did that solved said issue for me: 是的,这可能不是一个非常技术性的答案,但是以下是我为我解决了上述问题的方法:
YourClassNameHere.designer.cs
(usually found in the solution directory) YourClassNameHere.designer.cs
(通常在解决方案目录中找到) YourClassNameHere.designer.cs
from the directory. YourClassNameHere.designer.cs
。 I know it's a bit of a non-technical and flimsy solution to the problem, but it worked for me so hopefully it can work for someone else too. 我知道这是解决该问题的非技术性和脆弱性解决方案,但是它对我有用,因此希望它也可以对其他人有用。
you have to create your class by inheriting AddInBase
class as follows. 您必须通过继承
AddInBase
类来创建类,如下所示。
public partial class ThisAddIn : AddInBase
without inheriting a class how you can override a method of the base class? 在不继承类的情况下,如何重写基类的方法?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.