Build/Test Issues

Maui blazor hybrid tests issue

Started by Anish on 3,684 views

I'm working on Maui blazor hybrid app, nrucnh can't build maui project and see following trace:

Shared\BiometricLogin.razor.css (0, 0): The scoped css file 'Shared\BiometricLogin.razor.css' was defined but no associated razor component or view was found for it.
Shared\MainLayout.razor.css (0, 0): The scoped css file 'Shared\MainLayout.razor.css' was defined but no associated razor component or view was found for it.
Shared\RedirectToLogin.razor.css (0, 0): The scoped css file 'Shared\RedirectToLogin.razor.css' was defined but no associated razor component or view was found for it.

WARNING - ..\..\..\..\..\program files\microsoft visual studio\2022\community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (2382, 5): MSB3277: Found conflicts between different versions of "WindowsBase" that could not be resolved.
There was a conflict between "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "WindowsBase, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
"WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "WindowsBase, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
References which depend on "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\7.0.14\ref\net7.0\WindowsBase.dll].
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\7.0.14\ref\net7.0\WindowsBase.dll
Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\7.0.14\ref\net7.0\WindowsBase.dll".
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\7.0.14\ref/net7.0/WindowsBase.dll
References which depend on "WindowsBase, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
C:\Users\пк\.nuget\packages\microsoft.web.webview2\1.0.864.35\lib\netcoreapp3.0\Microsoft.Web.WebView2.Wpf.dll
Project file item includes which caused reference "C:\Users\пк\.nuget\packages\microsoft.web.webview2\1.0.864.35\lib\netcoreapp3.0\Microsoft.Web.WebView2.Wpf.dll".
C:\Users\пк\.nuget\packages\microsoft.web.webview2\1.0.864.35\lib\netcoreapp3.0\Microsoft.Web.WebView2.Wpf.dll
C:\Users\пк\.nuget\packages\syncfusion.licensing\21.2.10\lib\net7.0-windows7.0\Syncfusion.Licensing.dll
Project file item includes which caused reference "C:\Users\пк\.nuget\packages\syncfusion.licensing\21.2.10\lib\net7.0-windows7.0\Syncfusion.Licensing.dll".
C:\Users\пк\.nuget\packages\syncfusion.licensing\21.2.10\lib\net7.0-windows7.0\Syncfusion.Licensing.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.core\21.2.10\lib\net7.0\Syncfusion.Blazor.Core.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.buttons\21.2.10\lib\net7.0\Syncfusion.Blazor.Buttons.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.calendars\21.2.10\lib\net7.0\Syncfusion.Blazor.Calendars.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.cards\21.2.10\lib\net7.0\Syncfusion.Blazor.Cards.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.charts\21.2.10\lib\net7.0\Syncfusion.Blazor.Charts.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.data\21.2.10\lib\net7.0\Syncfusion.Blazor.Data.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.datavizcommon\21.2.10\lib\net7.0\Syncfusion.Blazor.DataVizCommon.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.dropdowns\21.2.10\lib\net7.0\Syncfusion.Blazor.DropDowns.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.grid\21.2.10\lib\net7.0\Syncfusion.Blazor.Grids.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.inputs\21.2.10\lib\net7.0\Syncfusion.Blazor.Inputs.dll
C:\Users\пк\AppData\Local\NCrunch\30572\6\App.UI.Components\bin\Debug\net7.0\App.UI.Components.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.layouts\21.2.10\lib\net7.0\Syncfusion.Blazor.Layouts.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.lists\21.2.10\lib\net7.0\Syncfusion.Blazor.Lists.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.navigations\21.2.10\lib\net7.0\Syncfusion.Blazor.Navigations.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.notifications\21.2.10\lib\net7.0\Syncfusion.Blazor.Notifications.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.pivottable\21.2.10\lib\net7.0\Syncfusion.Blazor.PivotView.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.popups\21.2.10\lib\net7.0\Syncfusion.Blazor.Popups.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.spinner\21.2.10\lib\net7.0\Syncfusion.Blazor.Spinner.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.splitbuttons\21.2.10\lib\net7.0\Syncfusion.Blazor.SplitButtons.dll
C:\Users\пк\.nuget\packages\syncfusion.blazor.treegrid\21.2.10\lib\net7.0\Syncfusion.Blazor.TreeGrid.dll


there is everything fine with files it works on all devices, but not with ncrunch, is there any workaround this issue?

Edited

Hi, thanks for sharing this issue.

My first guess here is that there is a type of file that is required for NCrunch to build this project, and NCrunch isn't automatically copying it to the workspace when it runs the build.

Most likely it's a .razor file or something similar. If you can identify the missing files, you can use the additional files to include setting to let NCrunch know about them so that they can be included in the workspace.

Also, if you're able to let me know which file it is, I can see about adding a fix to NCrunch so it will do this automatically in future.
Remco, thanks for your reply!

I tried to add files as you adviced (see screenshot https://imgur.com/a/chPwQg9 ) but it did not help.

if i remove css files trace does not contain any errors about those files anymore but there appears new one

MainPage.xaml (10, 44): Cannot resolve type "clr-namespace:Malue.App.UI.MAUI:Main".


is there anything else i can do?
I think there must be a range of files missing from the workspace.

Try this:
1. Wait until NCrunch has failed to build the project
2. Right click on the failed build, then choose Advanced->Browse to workspace
3. Use a diff tool (like Kdiff3) to compare this directory with the project one in your normal solution directory
4. This should highlight differences and may help to indicate which files are missing and may need to be included.
There are missed all razor files ( additional files does not affect at all).
Could it be related with maui project targets? if ncrunch rely on it.

And absolutly not clear what is wrong with MainPage.xaml page (
Could you try the following for me?

Open your NCrunch configuration and select the MAUI project in the config tree.

Go to the 'Additional files to include' setting. Choose to edit the setting. Click the button 'Add Manually', then enter in the value: **.razor

I've managed to reproduce the issue with missing Razor files on my side and this seems to resolve it. I think the MainPage.xaml issue is related (as it doesn't occur for me when the Razor imports are fixed).

I'm also submitting a fix for NCrunch so that for future versions you won't need to include these files manually.

Edited

I tried it but unfortunatly it does not work for me (still shows the same trace). I added this to each target https://imgur.com/a/HQtZKFP

Thanks for including fix to future versions, when i should excpect release with this changes?
It's not critical for me don't having maui test in short term, but i need it in long term.
I have the fix included in the build below .. though I'm uncertain as to whether this will solve the issue for you if the workaround didn't work. It's possible there's more to this problem. Give it a try and let me know how you go.

NCrunch_Console_5.5.0.3.msi
NCrunch_Console_5.5.0.3.zip
NCrunch_GridNodeServer_5.5.0.3.msi
NCrunch_GridNodeServer_5.5.0.3.zip
NCrunch_LicenseServer_5.5.0.3.zip
NCrunch_Rider_5.5.0.3.7z
NCrunch_Rider_5.5.0.3.zip
NCrunch_VS2010_5.5.0.3.msi
NCrunch_VS2010_5.5.0.3.zip
NCrunch_VS2012_5.5.0.3.msi
NCrunch_VS2012_5.5.0.3.zip
NCrunch_VS2013_5.5.0.3.msi
NCrunch_VS2013_5.5.0.3.zip
NCrunch_VS2015_5.5.0.3.msi
NCrunch_VS2015_5.5.0.3.msi.7z
NCrunch_VS2015_5.5.0.3.zip
NCrunch_VS2017_5.5.0.3.msi
NCrunch_VS2017_5.5.0.3.msi.7z
NCrunch_VS2017_5.5.0.3.zip
NCrunch_VS2019_5.5.0.3.msi
NCrunch_VS2019_5.5.0.3.msi.7z
NCrunch_VS2019_5.5.0.3.zip
NCrunch_VS2022_5.5.0.3.msi
NCrunch_VS2022_5.5.0.3.msi.7z
NCrunch_VS2022_5.5.0.3.zip
hey, i have an issue with updating ncrunch licence key, as soon as i do it i test version that you sent me
Anish wrote:hey, i have an issue with updating ncrunch licence key, as soon as i do it i test version that you sent me


Could you contact me directly through the contact form? We usually try to deal directly with people for licensing issues.

Post a reply

Log in to reply.