Webassembly example

I need a basic project example using the SFFileManager component for Blazor Webassembly (not Blazor Server). The existing documentation doesnt seem to be accurate enough to use in my Webassembly project.

Regards,
Amjad.

9 Replies 1 reply marked as answer

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team December 28, 2020 03:53 AM UTC

Hi Amjad Khan, 
 
Greetings from Syncfusion support. 
  
We have prepared a WebAssembly sample for FileManager component for your reference. 
  
  
Please, follow the following steps to configure FileManager in Blazor client-side Application, 
  
Step 1: Create a client-side hosted application like the above sample. 
  
Step 2: Include the below style url on the <head> element of the ~/wwwroot/index.html page. 
  
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" /> 
  
Step 3: Include Syncfusion.Blazor service and add builder.services.AddSyncfusionBlazor() method in the Main function on Program.cs file. 
  
Step 4: Import the Syncfusion.Blazor.FileManager Package on the ~/_Imports.razor file. 
  
@using Syncfusion.Blazor 
@using Syncfusion.Blazor.FileManager 
  
Step 5: Initialize the FileManager component on ~Pages/index.razor page. 
  
Step 6: Include Syncfusion.EJ2.AspNet.Core package on the server part. 
  
Step 7: Create a new file with .cs extension inside the Controllers folder on server part. In the above sample, we have included FileManager services inside the FileManagerController.cs file on Controllers folder. 
  
Step 8: Now press F5 to run the application after successful compilation. 
  
Please refer the following links to know more about the Blazor FileManager component. 
  
  
  
  
Please, let us know if you need any further assistance. 
  
Regards, 
Shameer Ali Baig S. 



AK Amjad Khan December 28, 2020 09:37 AM UTC

Does this work with latest .NET 5 because when I try to include this code into my project it is giving me errors like:


Error CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) IMS5_1.Client C:\Users\dajma\source\repos\IMS5_1\IMS5_1\Client\obj\Debug\net5.0\IMS5_1.Client.MvcApplicationPartsAssemblyInfo.cs 14 Active

Support appreciated.

Regards,
Amjad.


IL Indhumathy Loganathan Syncfusion Team December 29, 2020 09:39 AM UTC

Hi Amjad Khan,  
 
We have validated your reported problem but it is not reproduced in our validation sample and FileManager works properly without any issues. For your reference, we have attached a sample created in latest .NET 5.0.100-rc.2.20479.15 version with FileManager. 
 
Please, download the sample from the following link. 
 
 
Please refer the following links to know more about the Blazor FileManager component.  
   
   
  
   
Please, let us know if you need any further assistance.  
   
Regards,  
Indhumathy L 


Marked as answer

AK Amjad Khan December 30, 2020 10:43 AM UTC

Thanks for your help. The issue was resolved by removing the Syncfusion.Blazor package from Server project (it is only required in the Client project). However, when I am trying to install the Syncfusion.Blazor Nuget package version 18.4.0.31 I am getting the following error:

Error NU1605 Detected package downgrade: Microsoft.AspNetCore.Authorization from 5.0.0 to 5.0.0-rc.2.20475.17. Reference the package directly from the project to select a different version. 
 IMS5_1.Client -> Syncfusion.Blazor 18.4.0.30 -> Microsoft.AspNetCore.Components.Web 5.0.0 -> Microsoft.AspNetCore.Components 5.0.0 -> Microsoft.AspNetCore.Authorization (>= 5.0.0) 
 IMS5_1.Client -> Microsoft.AspNetCore.Authorization (>= 5.0.0-rc.2.20475.17) IMS5_1.Client C:\Users\dajma\source\repos\IMS5_1\IMS5_1\Client\IMS5_1.Client.csproj 1

If I install Syncfusion.Blazor version 18.3.x.x, it installs fine. All my other packages are on 5.0.0-rc2.20475.17. 

Any idea how can I install the latest Syncfusion.Blazor package?

Regards,
Amjad.


IL Indhumathy Loganathan Syncfusion Team December 31, 2020 10:27 AM UTC

Hi Amjad Khan, 
 
We have validated your reported problem, but it is not reproduced in our validation sample. We suspect that this issue occurs due to .NET version. 
 
The error says that your machine has .NET 5.0 version and the packages are available in .NET 5.0.0-rc.2.20475.17 version. 
 
To resolve this issue, you can either update your dependent packages version or the .NET version of your machine. 
 
Please follow the below steps to run the sample, 
 
1.      Delete the bin and obj folders from your sample. 
 
2.      Clear browser cache and clean your solution. 
 
3.      After compilation, Run the project by pressing F5. 
 
If your reported problem still persists, then please let us know your convenient time for scheduling a web meeting session. We will check the cause of your reported problem and help you solve it in the live meeting session. 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Indhumathy L 



AK Amjad Khan January 4, 2021 10:23 AM UTC

Ok, I got it working. Upgrade to Syncfusion.Blazor version 18.4.x.x requires installation of Microsoft.AspNetCore.Http package version 2.2.2. This was not the case with version 18.3.x.x. If I don't install Microsoft.AspNetCore.Http package, I get Http not recognized errors by Visual Studio. Hope someone else can benefit from this.


IL Indhumathy Loganathan Syncfusion Team January 5, 2021 06:31 AM UTC

Hi Amjad Khan, 
 
Thanks for the update. 
 
Unfortunately, we were unable to reproduce the reported issue(HTTP errors) in our validation sample. Our Syncfusion.Blazor 18.4.X.X version package is working fine with the lower version of Microsoft.AspNetCore.Http package. 
 
In the below attachment, we have included our validation sample with video footage, 
 
 
Please check the above sample and if issue persists , revert us with a video along with the steps reproduce the reported issue in the provided sample.  Please let us know if you need further assistance.  

Regards, 
Indhumathy L 



AK Amjad Khan replied to Indhumathy Loganathan January 5, 2021 07:38 AM UTC

Hi Amjad Khan, 
 
Thanks for the update. 
 
Unfortunately, we were unable to reproduce the reported issue(HTTP errors) in our validation sample. Our Syncfusion.Blazor 18.4.X.X version package is working fine with the lower version of Microsoft.AspNetCore.Http package. 
 
In the below attachment, we have included our validation sample with video footage, 
 
 
Please check the above sample and if issue persists , revert us with a video along with the steps reproduce the reported issue in the provided sample.  Please let us know if you need further assistance.  

Regards, 
Indhumathy L 


Thank you for your feedback. As I reported, I have my project working. It is just that in my case, installing Microsoft.AspNetCore.Http package was necessary. With version 18.3 of Syncfusion.Blazor, it was not. That is the only change I had to make. I mean, if I remove Microsoft.AspNetCore.Http package, I get compilation errors. If I include this package, everything is fine.


SP Sowmiya Padmanaban Syncfusion Team January 6, 2021 04:39 AM UTC

Hi Amjad Khan,  
  
Thanks for the update. 
  
 Please let us know, if you need any further assiatnce with FileManager component. 
  
Regards,  
Sowmiya.P 


Loader.
Up arrow icon