Maui partial class false compiler errors that do not prevent build and deploy

59 Views Asked by At
Partial method 'PlatformSpecificHelper.Close()' must have an implementation part because it has accessibility modifiers.    

I am getting an error like this for every single method in my Static helper class, but it does not prevent compilation, building and deployment, and the methods all work as intended. It is like the (not too uncommon) intellisense errors, which goes away on their own, except these do not go away, though they also do no real harm.

I have a partial class defined in main maui code as well as in the platform specific folders. A simplified example is General code:

namespace Util;
public static partial class PlatformSpecificHelper
{
    public static partial void Close();

Android code (ios looks the same):

namespace Util;
public static partial class PlatformSpecificHelper
{
    public static partial void Close()
    {
        try
        {........

I tried deleting the bin and obj files in the project folder and then the errors are gone on restart, but come back after a little bit, when project is reinitialized. Cleaning and rebuilding does not remove them.

I saw others having (different) issues with partial classes and codemaid. I am actually using codemaid, so I disabled it, deleted bin and obj and restarted and it seemed to fix it. Then I turned it back on and off to verify, and then it did no difference (errors popped up) . So, it is probably not related.

Again, this code looks right, and it works perfectly, but I am getting spammed with 19 errors like the one mentioned, which is quite annoying.

0

There are 0 best solutions below