mfractor / mfractor-feedback

Found a bug or have a feature request for MFractor? Submit it here!
3 stars 0 forks source link

Intermittent issue with MFractor recognising Static Resources #316

Closed eddieyanez closed 3 years ago

eddieyanez commented 3 years ago

I've sent this via email to matthew@mfractor.com on 6th January however I've not received a response. Can you please check and get back to me?


Hi Matthew,

I’m not sure if this is something I should be posting on Github.

Ever since installing MFractor I cannot get it to reliably recognise resources from App.xaml file. I keep getting squiggly red lines everywhere. Sometimes they go away, sometimes they come back. Sometimes they come back once I re-open the page. I’ve tried running re-sync’ing resources several times which seems to help but I don’t think that I should have to do this so often.

Can you please help? Let me know what you need from me.

Examples below (all red lines on scroll bar are related):

image001 image002

Additionally, the documentation states that MFractor works with Resizetizer.NT but I also get squiggly red lines for those:

image003

Here’s my App.xaml with the defined resources.

image004

Regards, Eddie

Installation Information

--Platform Information--
Operating System: Mac
OS: Unix
OS Service Pack: 
OS Version: Unix 20.2.0.0
--MFractor Information--
Product Name: MFractor
Product Version: 4.4.6.0
Product Variant: Visual Studio Mac
Product Variant Version: 8.8.6.15
Product SKU: MFRACTOR-VS-MAC
Commit SHA: a14206200021780a734ed27eebfe52fe754d98b2
Revision: 4693
Branch: master
Date: 21/12/2020 3:33:25 AM (UTC)
Agent: Local
Installed extensions:   'MFractor (4.4.6)', 'Forms Project Support (8.8.5)', 'NuGet Package Management (8.8.6)', 'Azure Support (8.8.6)', 'Xamarin Ide Identity (8.8.6)', 'Text Templating (8.8.6)', 'iOS development (8.8.5)', 'MonoDevelop Text Editor (8.8.6)', 'Xamarin.Mac development (8.8.5)', 'iOS Designer (16.8.0.510)', 'Project Web References (8.8.6)', 'Mono Soft Debugger Support (8.8.6)', 'Debugger support for MonoDevelop (8.8.6)', 'XamlLanguageService (16.8.0.510)', 'Version Control Support (8.8.6)', 'NUnit support (8.8.6)', 'ILAsm Language Binding (8.8.6)', 'Subversion core engine (8.8.6)', 'Azure Mobile App Service (8.8.5)', 'Visual Designer Support (8.8.6)', 'Test Runner (8.8.6)', 'Git support (8.8.6)', 'Mac Development (8.8.5)', 'CSharp Language Binding (8.8.6)', 'MonoDevelop Assembly Browser (8.8.6)', 'NuGet Packaging (8.8.6)', 'GTK# Visual Designer (8.8.6)', 'Android Designer (16.8.0.510)', 'Refactoring Support (8.8.6)', 'Xamarin Hot Reload (1.0.0.4127551)', 'Web Project Support (8.8.6)', 'Azure Functions development (8.8.6)', 'Web Editors (8.3)', 'JavaScript Debugger (8.8.6)', 'Xamarin.Forms Previewer (16.8.0.510)', 'Xamarin Addins Core (8.8.5)', 'Xamarin Designer (16.8.0.510)', '.Net Core Debugger (8.8.6)', 'Subversion support (8.8.6)', 'Container Tools (1.0.20200521.1)', 'Azure DevOps Authentication Support (8.8.6)', 'ASP.NET Core Support (8.8.6)', 'VB.NET Language Binding (8.8.6)', 'XML Editor (8.8.6)', 'MonoDevelop Source Editor (8.8.6)', 'JavaScript and TypeScript (8.3)', 'Razor Language Services (8.0.20201102.3)', 'Gettext Translations Support (8.8.6)', 'Mono Soft Debugger Support for ASP.NET (8.8.6)', 'Visual Studio for Mac Tools for Unity (2.8.4.0)', 'Xamarin Test Cloud - NUnit (8.8.5)', 'Makefile generation (8.8.6)', 'MonoDevelop Hex Editor (8.8.6)', 'Android Deploy (16.8.0.510)', 'GDB Debugger Support (8.8.6)', 'Xamarin Ide Extensions for Mac (8.8.6)', 'VisualFSharp (8.8.6)', 'Xamarin Ide Extensions (8.8.6)', 'Android development (8.8.5)', 'Deployment Services Core (8.8.6)', 'VsCode Debug Protocol support for MonoDevelop (8.8.6)', 'MonoDevelop Text Editor (8.8.6)', 'Regex Toolkit (8.8.6)', 'MonoDevelop Mac Platform Support (8.8.6)', 'Xamarin Test Cloud (8.8.5)', 'Extension Developer Tools (8.8.6)', 'ConnectedServices (8.8.6)', '.NET Core Support (8.8.6)', 'Xamarin Terminal (8.8.6)', 'ChangeLog Add-in (8.8.6)', 'Performance Diagnostics of IDE (8.8.6)', 'Unit Testing core support (8.8.6)'
ravero commented 3 years ago

Hello @eddieyanez, thanks for reaching. Matthew is taking a few days, in the mean time I'll assist you.

This is an issue so no problem posting it here. When you find this inconsistent behavior can you please try to invoke the Resync MFractor Solution Resources from the MFractor/Tools menu?

Screen Shot 2021-01-24 at 11 27 52

MFractor keeps a cache of the resources in the project like static resources, so we can lookup quickly to provide those meaningful warnings without having to re-parse the files all the time, which would impact the performance. There are several events that triggers this caching mechanism and sometimes it gets out of sync with the project state. This are mostly edge cases, just need to make sure that this is related to the resource sync. If your environment is getting too crazy and this out of sync happens to frequently, we will check further what's may happening.

Is it ok to you to proceed this way? Best regards, Rafael Veronezi

eddieyanez commented 3 years ago

Hi @ravero, thanks. I re-sync the cache often which fixes the issue but only for a few minutes, and then I have to do it again. This also happens whenever I close and re-open the page. If the issue was every day or so, it would be fine, but as it is, it doesn't work for me. My solution has the usual shared + android + iOS projects, a .net core web project and the core library. I wouldn't say this is edge case or that my environment is too 'crazy', albeit I don't know exactly what you're trying to say by that.

ravero commented 3 years ago

Sorry @eddieyanez if I sounded confusing at first. By too crazy I meant to the problem itself, in a sense that if that happens too often we really need to check further. By edge case I meant that having to resync would be necessary very rarely.

So there's really something going on there. Can you confirm me if this happens only to this solution or overall?

Please send me logs so I can start investigating, you can post it here or mail me at rafael@mfractor.com.

Sorry for the inconvenience. Regards, Rafael Veronezi

eddieyanez commented 3 years ago

I will try with another solution and let you know.

Sure, how do I extract the logs?

Not sure if you noted on my initial email but there was a mention of MFractor not working with Resizetizer.NT - something else to investigate. This has never worked, even when after re-synchronising Mfractor solution resources. I couldn't find further information except for a feature page here https://docs.mfractor.com/image-management/third-party/resizetizer/.

eddieyanez commented 3 years ago

I can confirm that the issue also happens when working on a bare-bones project. For this, I've used the same project that I've shared with the Xamarin.Forms team here #13506.

  1. I've added some of the Resources from my app to the App.xaml of the sample project (below A)
  2. Forced an MFractor resync
  3. Opened APage.xaml and added the following code (below B)
  4. Closed the page
  5. Opened it again and converted the the Padding of an element to a Static Resource using MFractor
  6. Squiggly red lines appear for the padding resource just converted by MFractor, and my previous addition (screenshot below C).

You can download the solution with the code notes above here: TestSolution-MFractor.zip

Note A

<Application.Resources>

    <ResourceDictionary>
        <Color x:Key="Primary">#2196F3</Color>
        <Style TargetType="Button">
            <Setter Property="TextColor" Value="White"></Setter>
            <Setter Property="VisualStateManager.VisualStateGroups">
                <VisualStateGroupList>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal">
                            <VisualState.Setters>
                                <Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                            <VisualState.Setters>
                                <Setter Property="BackgroundColor" Value="#332196F3" />
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateGroupList>
            </Setter>
        </Style>
    </ResourceDictionary>

    <!-- Colours and other basic items -->
    <Color x:Key="SwitchedBlue">#2966AD</Color>
    <Color x:Key="SwitchedRed">#CE0303</Color>
    <Color x:Key="SwitchedOrange">#E28800</Color>
    <Color x:Key="SwitchedYellow">#E0CD21</Color>
    <Color x:Key="SwitchedBlack">#302F2F</Color>
    <Color x:Key="SwitchedWhite">#FFFFFF</Color>
    <Color x:Key="SwitchedGrey">#A9A9A9</Color>
    <Color x:Key="SwitchedGreen">#2AB028</Color>

    <Color x:Key="SwitchedBackground">#F2F2F2</Color>
    <SolidColorBrush x:Key="SwitchedBackgroundBrush" Color="{StaticResource SwitchedBackground}"/>
    <Color x:Key="SwitchedAltBackground">#DEDEDE</Color>

    <Thickness x:Key="SwitchedFlowMargin" Bottom="10" />
    <Thickness x:Key="SwitchedPadding">20</Thickness>
    <Thickness x:Key="SwitchedSmallPadding">10</Thickness>
    <Thickness x:Key="SwitchedButtonPadding">6,12</Thickness>

    <x:Int16 x:Key="Spacing">30</x:Int16>

</Application.Resources>

Note B

        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedBlack}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedRed}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedBlue}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedGrey}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedWhite}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedYellow}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedGreen}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedBackground}" />
        <Label Text="Page A" FontSize="24" BackgroundColor="{StaticResource SwitchedAltBackground}" />

Note C

Screenshot 2021-01-24 at 16 56 56
ravero commented 3 years ago

To extract the logs:

You can zip them and send me!

eddieyanez commented 3 years ago

Sent via email. Let me know if any issues or if you need more info.

eddieyanez commented 3 years ago

Any news? I've sent you the logs 4 days ago. Have you received the email?

matthewrdev commented 3 years ago

@eddieyanez I can reproduce this issue in the sample solution that you've provided and am looking into it now.

ravero commented 3 years ago

@eddieyanez we've published the version 4.4.7 of MFractor. Can you confirm if this resolved your issue? Thanks.

eddieyanez commented 3 years ago

Hi Rafael, I've given the latest update a try for a few days now and it seems to have addressed the issue with the unrecognised resources. Amazing work!

However, the Resizetizer.NT issue also noted in the OP remains an issue. These are never recognised.

Eddie

ravero commented 3 years ago

Hi @eddieyanez, Thanks for your response, I'm glad its working fine now. About the Resizetizer.NT, this is a different issue and I would like to ask if you mind I'm closing this one and opening a new issue specific to the other problem. I'm already investingating on that one. Regards.

eddieyanez commented 3 years ago

Of course. Let me know how I can help.