[Mono-list] mono compiler: error CS0115 when overriding a method

lfont ljph.fontaine at gmail.com
Wed Jan 5 16:20:18 EST 2011


Hello,

I try to compile a file that contains a class that inherits from another one
which is defined in an external assembly. The class from the file override a
method marked as virtual but when i try to compile it with gmcs it give me
the following error:

src\extensions\apps.cs(911,50): error CS0115:
`Google.GData.Extensions.Apps.Rfc8
22MsgElement.CreateInstance(System.Xml.XmlNode,
Google.GData.Client.AtomFeedPars
er)' is marked as an override but no suitable method found to override

I use this command to compile (the version of mono is 2.8.1):

"C:\Program Files\Mono-2.8\bin\gmcs" /d:"TRACE;MonoDroid" -target:library
-out:Google.GData.Extensions.dll -r:Google.GData.Client.dll -noconfig
-nostdlib+ -r:"C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoDroid\v2.0\mscorlib.dll" -r:"C:\Program
Files\Reference Assemblies\Microsoft\Framework\MonoDroid\v2.0\System.dll"
-r:"C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoDroid\v2.0\System.Xml.dll" -r:"C:\Program
Files\Reference
Assemblies\Microsoft\Framework\MonoDroid\v2.0\System.Web.Services.dll"
src\extensions\apps.cs

The compilation of the file works with the .NET compiler with the same
command arguments:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /d:"TRACE;MonoDroid"
-target:library -out:Google.GData.Extensions.dll -r:Google.GData.Client.dll
-noconfig -nostdlib+ -r:"C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoDroid\v2.0\mscorlib.dll" -r:"C:\Program
Files\Reference Assemblies\Microsoft\Framework\MonoDroid\v2.0\System.dll"
-r:"C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoDroid\v2.0\System.Xml.dll" -r:"C:\Program
Files\Reference
Assemblies\Microsoft\Framework\MonoDroid\v2.0\System.Web.Services.dll"
src\extensions\apps.cs

The code looks like this (these lines of code are from the gdata library
http://code.google.com/p/google-gdata/):

public abstract class ExtensionBase : IExtensionElementFactory,
IVersionAware
{
   public virtual IExtensionElementFactory CreateInstance(XmlNode node,
AtomFeedParser parser) 
   {
		// some codes here
   }
}

public class Rfc822MsgElement : ExtensionBase
{
   public override IExtensionElementFactory CreateInstance(XmlNode node,
AtomFeedParser parser)
   {
		// some codes here
   }
}

Do i need to do something special to get it to compile with mono?

Thanks,

-- 
View this message in context: http://mono.1490590.n4.nabble.com/mono-compiler-error-CS0115-when-overriding-a-method-tp3176455p3176455.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list