Blazor Server project is not running after installing Blazorise.Snackbar component - blazorise

In my Blazor Server project I have been using blazorise controls. I started this project 3 months before. Now I wanted to use Blazorise.Snackbar component. So I ran nuget package command to install the component. Now my project is not running. It shows exception in the below lines of code in the Program.cs file
builder.Services.AddBlazorise(options => { options.Immediate = false; })
.AddBootstrap5Providers()
.AddFontAwesomeIcons()
.AddBlazoriseRichTextEdit();
The error message is:
System.TypeLoadException: 'Method 'FocusTrap' in type
'Blazorise.Bootstrap5.Bootstrap5ClassProvider' from assembly
'Blazorise.Bootstrap5, Version=1.0.4.0, Culture=neutral,
PublicKeyToken=null' does not have an implementation.'
My Current Packages version:
Can anyone help me to solve the problem?

You should use the same version on all Blazorise packages to ensure that they are compatible with each other. Changing Blazorise.Snackbar version to 1.0.4 will fix your problem.

Related

Integration testing in ASP.NET Core Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException

For this error, I have tried multiple solutions which is provided by Github. But, none of them worked. Please help to check whether this issue reopen on new environment like below.
Environment:
VS 2017 Version 15.4.1
Dotnet Version 2.0.2
Reproduce Steps:
Create an Asp.Net Core Web Application->.NET Core and Asp.net Core 2.0-> Web Application(Model-View-Controller)
Create an xUnit Test Project(.NET Core)
Follow this link Integration testing in ASP.NET Core
Add true to Test.csproj which is pointed at above link.
Run test method will return below error.
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException : One or more compilation failures occurred:
ewiqttdv.z4g(4,62): error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Update:
After following this suggestion , this error gone, but, it produce below new error.
Message: System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.VisualStudio.Web.CodeGeneration, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
What is the possible way to resolve "Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException"?
Any help would be appreciated.
A bit late, but I ran in to the same problem today and managed to fix the "Could not load file or assembly 'Microsoft.VisualStudio.Web.CodeGeneration ..." error by adding the following reference to my integration test project:
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.1" PrivateAssets="All" />

Cannot reference monotouch.dll when using SQLCipher?

I have a Xamarin iOS project where I have just added SQLCipher to my packages. I now get a build error saying:
iOS/MTOUCH: Error MT0034: Cannot reference 'monotouch.dll' in a
Xamarin.iOS project - it is implicitly referenced by
'SQLite.Net.Platform.SQLCipher.XamarinIOS, Version=4.1.1.0,
Culture=neutral, PublicKeyToken=null'. (MT0034) (myProject.iOS)
I'm not sure how to fix this, I have tried deleting the sqlcipher package and adding again, rebuilding, and restarting Xamarin but no luck. Thanks for any help

LinkAssemblies fails after upgrading to MVVMCross 4.0

I have just updated a large Xamarin project from MVVMCross version 3.5 to 4.0. I have fixed all namespace issues and bugs, but I am stuck with this bug:
The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item
'System.Boolean Android.OS.BaseBundle::GetBoolean(System.String,System.Boolean)'
(defined in 'MvvmCross.Droid.FullFragging, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=null') from 'MvvmCross.Droid.FullFragging, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=null' could not be resolved. --->
Mono.Cecil.ResolutionException:
Failed to resolve System.Boolean Android.OS.BaseBundle::
GetBoolean(System.String,System.Boolean)
I have added MvvmCross.Droid.FullFragging.* to linkerConfig.xml, but to no avail.
I experienced the same issue. The MvvmCross dlls are build to version v6.0 for android. I noticed the following output tab (My logging is set to verbose).
warning XA0105: The $(TargetFrameworkVersion) for MvvmCross.Binding.Droid.dll (v6.0) is greater than the $(TargetFrameworkVersion) for your project (v5.0).
When I changed the projects to Android 6.0 I still received the linker error. When I opened the project file in a text editor I noticed that was defined twice. Once in the global property group set to 6.0 and once in the Debug property group set to 5.0. I removed the following line from the Debug property group and the issue went away.
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
What you need to do is to switch on verbose logging in your build. For iOS specify verbose logging by adding:
-v -v -v -v
To the extra build parameters textbox. Then run the build again.
For Android you can do this in the Visual Studio Tools -> Settings -> Xamarin -> Android settings -> Xamarin Diagnostics.
You will probably identify that some packages are of different versions and will cause this linking issue.
You will find some clues to the issue using verbose logging. I have only mentioned the verbose logging for this platform as its the platform I have most experience with at the moment.
This is the best answer I can offer as this issue can be caused by a truly massive number of issues and will be individual to each solution.

publish project in vs2013

I have a project that builds and is publish correctly before I moved to Windows 10. After I updated to Windows 10 I can build and test my project but I cannot publish my MVC project. It gives me the following error which I do not understand:
Could not load file or assembly 'Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I added Microsoft.Web.Deployment from nuget but I still get the same error.
Following will solve your problem
Downloaded Web Deploy 3.5, from http://www.iis.net/downloads/microsoft/web-deploy
install complete package
Then open your project in VS 2013.
Publish your project.
Thanks

Ninject.MVC3 Package requires MVC5?

I've installed the Ninject.MVC3 -Version 3.0.0.6 package but get the following error.
An exception of type 'System.IO.FileNotFoundException' occurred in Ninject.dll
but was not handled in user code
Additional information: Could not load file or assembly 'System.Web.Mvc, Version=5.2.2.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
I presume that this means that the version of the ninject.MVC3 package i've installed requires MVC5 which strikes me as rather odd.
I ended up resolving this by manually installing Ninject MVC using the Global.asax way of registering services as laid out here.

Resources