jeudi 1 mai 2014

c# - classe n'implémente pas le membre abstrait hérité X, erreur dans le fichier g.i.cs ? -Débordement de pile


I'm having a really strange problem with what should be a simple inheritance implementation. I am getting the following error during compilation, even after a full clean & rebuild, and even after completely deleting the bin and obj sub-directories:


VideoPlayer1' does not implement inherited abstract member GetShareContent(Windows.ApplicationModel.DataTransfer.DataRequest)
File: VideoPlayer1.g.i.cs

I have checked the method signatures between the two classes and they are identical:


public abstract class SharePage : Common.LayoutAwarePage
{
protected abstract bool GetShareContent(DataRequest request);
}

public sealed partial class VideoPlayer1 : SharePage
{
protected override bool GetShareContent(DataRequest request)
{
}
}

And I still get the error. The weird thing is that it's references the generated file VideoPlayer1.g.i.cs as the source of the error instead of the main code-behind file, VideoPlayer1.xaml.cs. I've never seen that before.


As an additional test I changed the name of the method in the derived class to GetShareContentX(). As expected the compiler warns me that no suitable method was found in the base class to override and also warns me that I'm trying to introduce a new virtual method in a sealed class.


I've read a lot of SO posts on this error message but none of them talked about it happening in the g.i.cs file. Has anybody else seen this?



I'm having a really strange problem with what should be a simple inheritance implementation. I am getting the following error during compilation, even after a full clean & rebuild, and even after completely deleting the bin and obj sub-directories:


VideoPlayer1' does not implement inherited abstract member GetShareContent(Windows.ApplicationModel.DataTransfer.DataRequest)
File: VideoPlayer1.g.i.cs

I have checked the method signatures between the two classes and they are identical:


public abstract class SharePage : Common.LayoutAwarePage
{
protected abstract bool GetShareContent(DataRequest request);
}

public sealed partial class VideoPlayer1 : SharePage
{
protected override bool GetShareContent(DataRequest request)
{
}
}

And I still get the error. The weird thing is that it's references the generated file VideoPlayer1.g.i.cs as the source of the error instead of the main code-behind file, VideoPlayer1.xaml.cs. I've never seen that before.


As an additional test I changed the name of the method in the derived class to GetShareContentX(). As expected the compiler warns me that no suitable method was found in the base class to override and also warns me that I'm trying to introduce a new virtual method in a sealed class.


I've read a lot of SO posts on this error message but none of them talked about it happening in the g.i.cs file. Has anybody else seen this?


0 commentaires:

Enregistrer un commentaire