Running into an error when TryMudBlazor is run on Chrome - mudblazor

Recently TryMudBlazor seems to run into problems on Chrome when trying out the examples from the MudBlazor site. This seems to be something that is happening more recently. Everything works fine on Microsoft Edge. Getting error:
blazor.webassembly.js:1 System.AggregateException: One or more errors occurred. (Could not resolve type with token 0100006c from typeref (expected class 'Try.UserComponents.__Main' in assembly 'Try.UserComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'))
---> System.TypeLoadException: Could not resolve type with token 0100006c from typeref (expected class 'Try.UserComponents.__Main' in assembly 'Try.UserComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null')
at TryMudBlazor.Client.Program.Main(String[] args)
--- End of inner exception stack trace ---

I got a suggestion to clear browser cookies and try it again on Chrome and that seemed to have worked.

Related

Could not resolve w/ token 01000060 from typeref(expecte class'Xamarin.Forms.FlyoutPage' in assembly'Xamarin.Forms.Core,Version=2.0.0.0,Token=null

System.TypeLoadException: 'Could not resolve type with token 01000060 from typeref (expected class 'Xamarin.Forms.FlyoutPage' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null')'
[1]: https://i.stack.imgur.com/m7qN9.png
Hello,
I am making an app on xamarin, and and after adding the FlyoutPage on Xaml and Xaml.cs to make the sliding Menu it's giving me this error.
Can anyone help me please? Thank you..

Xamarin Forms IOS App fails on Database.Migrate()

Good day,
I have a Xamarin Forms App that is cross platform for Android and IOS. I have developed and tested it on android for a while now and everything runs and works fine, but when I try to run the IOS on an emulator, the app keeps failing on the Database.Migrate line.
Please see below:
private readonly string _databasePath;
public DataContext()
{
Database.Migrate();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite($"Filename={Singletons.ApplicationSingleton.Instance.DatabasePath}");
}
The error I am getting is the following:
System.TypeLoadException: 'Could not resolve type with token 010000f8 from typeref (expected class 'System.ComponentModel.DataAnnotations.Schema.ColumnAttribute' in assembly 'System.ComponentModel.Annotations, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')'
I have had a look at all the references and all is the same versions and also removed the Database.Migrate line, but then it fails as soon as I try to access data in the database.
Has someone ever experienced this? Any solutions would be much appreciated.
Try to replace Database.Migrate(); with Database.EnsureCreated();in class constructor.
The offcial sample works fine on my side .
Refer to the source code https://github.com/dotnet/EntityFramework.Docs/blob/2466943d0fb22f4566e289643890baedddf37478/samples/core/Xamarin/EFGetStarted/Services/BloggingContext.cs#L17 .

Unable to load asset-classic ways already verified

I already try to run pub get, hot reload and my sentence is right. this is my error :
Exception caught by image resource service
The following assertion was thrown resolving an image codec:
Unable to load asset: images/cover.jpg

Rotativa component throws error Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1 while generating the pdf in MVC project

I have used this component to generate a pdf document based out of a dynamic view content. On testing at DEV and Staging environment, it worked fine and on Production environment, it throws below shown error.
Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Rotativa Version: 1.0.0.0
System.Web.Mvc Version: 5.2.3.0
I have given the binding redirect in web.config as below.
bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"
Code:
var pdfLetter = new Rotativa.ViewAsPdf(viewName, viewModel);
pdfLetter.FileName = fileName;
pdfLetter.PageSize = Rotativa.Options.Size.A4;
pdfLetter.PageOrientation = Rotativa.Options.Orientation.Portrait;
pdfLetter.PageMargins = new Rotativa.Options.Margins { Left = 4, Right = 1 };
var letterBytes = pdfLetter.BuildPdf(ControllerContext);
return letterBytes;
Web Application is not referencing the 3.0.0.1 version anywhere and still it throws the error. Tried to check the available Stack Overflow threads to fix.
Does anyone encountered this same problem and have any workaround to fix?
There was config value mismatch for MVC redirect between two environments and system was not able to recognize it. Fixed the issue by creating the web.config redirect section from the scratch.

App crashes when Link All Assemblies enabled

I am trying to reduce app size and enabled "Link All Assemblies", but my app crashes with following error
MvvmCross.Platform.Exceptions.MvxException: Failed to construct and initialize ViewModel for type Japam.Core.ViewModels.MantraasViewModel from locator MvxDefaultViewModelLocator - check InnerException for more information
I tried
--linkskip=mvvmcross.platform.ios
--linkskip=mvvmcross.core
--linkskip=mvvmcross.platform
but no luck, kept preserve attribute at assembly level of my core pcl project.
Also added a couple of more methods in LinkerPleaseIncludefile
public void Include(MvvmCross.Platform.IoC.MvxPropertyInjection injection)
{
injection = new MvvmCross.Platform.IoC.MvxPropertyInjection();
}
public void Include(MvxDefaultViewModelLocator locator)
{
locator = new MvxDefaultViewModelLocator();
}
but no use, could somebody help me find out what is missing
MvvmCross.Platform.Exceptions.MvxException: Failed to construct and initialize ViewModel for type
Japam.Core.ViewModels.MantraasViewModel from locator
MvxDefaultViewModelLocator - check InnerException for more information
---> MvvmCross.Platform.Exceptions.MvxException: Problem creating viewModel of type MantraasViewModel --->
MvvmCross.Platform.Exceptions.MvxIoCResolveException: Failed to
construct MantraasViewModel --->
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
MvvmCross.Platform.Exceptions.MvxIoCResolveException: Failed to
resolve parameter for parameter sqliteConnectionFactory of type
IMvxSqliteConnectionFactory when creating
Japam.Core.Services.DataServices.MantraService
at MvvmCross.Platform.IoC.MvxSimpleIoCContainer.GetIoCParameterValues
(System.Type type, System.Reflection.ConstructorInfo firstConstructor)
[0x00036] in D:\git\MvvmCross\MvvmCross\Platform\Platform\IoC\
Finally I found the issue, it's SQLite problem so I added below three commands and it started working hope this helps someone else
--linkskip=MvvmCross.Plugins.Sqlite
--linkskip=SQLite-net
--linkskip=MvvmCross.Plugins.Sqlite.iOS
I should kept SQLite earlier it self my last project I did kept SQLite but forgot this time

Resources