We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FileManager sample code not compiling

I downloaded the sample code of FileManager Blazor component (FileManager-806090727) and while trying to run that I get the below build error. Kindly suggest what could be wrong.

MSB3073 The command "dotnet "C:\Users\username\.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview9.19465.2\targets\../tools/Microsoft.AspNetCore.Blazor.Build.dll" write-boot-json "obj\Debug\netstandard2.0\FileManager.Client.dll" --references "D:\Samples\FileManager-806090727\FileManager\Client\obj\Debug\netstandard2.0\blazor\bootjson-references.txt" --embedded-resources "D:\Samples\FileManager-806090727\FileManager\Client\obj\Debug\netstandard2.0\blazor\embedded.resources.txt" --linker-enabled --output "D:\Samples\FileManager-806090727\FileManager\Client\obj\Debug\netstandard2.0\blazor\blazor.boot.json"" exited with code -2147450730. FileManager.Client C:\Users\username\.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview9.19465.2\targets\Blazor.MonoRuntime.targets

7 Replies

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team October 28, 2019 07:06 AM UTC

Hi Saravanan,

Thanks for contacting Syncfusion support.

We have looked into your query on File Manager. Based on the provided details, we suspect that the reported issue might have caused due to the failure in restoring the NuGet packages referred in your application. Please, check out the below link to successfully restore the NuGet packages in your application.

https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore

For your convenience, we have attached a simple Blazor sample with EJ2 File Manager.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Server_side582670267.zip

To know more about EJ2 File Manager, please check out the below links.

Demo Samples: https://ej2.syncfusion.com/blazor/FileManager/Overview?theme=material

Documentation: https://ej2.syncfusion.com/blazor/documentation/file-manager/getting-started/?no-cache=1

Please, let us know if you need any further assistance.

Regards,

Shameer Ali Baig S.



SA Saravanan Arumugam October 29, 2019 02:50 AM UTC

Hi Shameer,

Thanks for the reply, The sample application zip file you had given the link is not of File manager, it is of Side bar and Weather forecast. I tried even the restore actions and it didn't help. Kindly attached the sample working code of File manager Server and Client applications.

Thank you.
Saravanan. A


SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team October 29, 2019 06:03 AM UTC

Hi Saravanan,

 

We deeply regret for the inconvenience.

 

We have prepared both the server-side and client-side applications with File Manager for your convenience. Please, find the download the samples from the below link.

 

Samples: https://www.syncfusion.com/downloads/support/forum/148583/ze/FileManager_Client336863768

 

Documentation Sample: https://ej2.syncfusion.com/blazor/documentation/file-manager/getting-started/?no-cache=1#adding-file-manager-component-namespace-to-the-application   

 

The NuGet packages may fail to restore in the following cases,

 

  • Before restoring the NuGet packages of your application, make sure any local packages from your machine is not checked in Package Manager Settings.

 

  • If the NuGet packages already installed is not restored properly, then try uninstall and reinstall it, properly.

             https://ej2.syncfusion.com/blazor/documentation/file-manager/getting-started/?no-cache=1#adding-file-manager-component-namespace-to-the-application

 

  • Ensure File Manager namespaces are referred properly in your application.

             https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#restore-packages-manually-using-visual-studio

 

We have ensured our demo sample application link from our documentation and it is working properly at our end. So, could you please check the attached sample application and let us know whether they resolve the issue at your end. If the issue still exist, then please share more details about the issue like the following below.

 

  • Dotnet SDK version.
  • EJ2 Version.
  • Visual Studio version.

 

If possible, please share us a issue replicating sample. It will help us to isolate the issue and provide you the solution for resolving it, as early as possible.

 

Regards,

Shameer Ali Baig S.




SA Saravanan Arumugam October 29, 2019 11:15 AM UTC

Hi Shameer,

Let me explain few more details on what I am trying to achieve. I have a Blazor Server application with Controllers and Pages. From one of the pages I want to show the files in Azure blob using SF's File manager. To begin with, I added <EjsFileManager> component, getting data from https://ej2services.syncfusion.com/production/web-services/api/FileManager/FileOperations. This shows the content in File manager. When I change this point to one of my controllers (FM/FilesProvider/Files), I get the below error.
     NetworkError: Failed to send on XMLHTTPRequest: Failed to load /FM/FilesProvider/Files

Given below other details:
Dotnet SDK version: .NET Core 3.1
EJ2 Version: Syncfusion.EJ2.Blazor - Version="17.3.0.19-beta
     Syncfusion.EJ2.FileManager.AzureFileProvider.AspNet.Core - Version="17.3.0.14"
Visual Studio version: VS Professional 2019 Preview (16.3.0 - Preview 3)

Thank you.
Saravanan. A



SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team October 30, 2019 05:09 AM UTC

Hi Saravanan,

 

Based on your provided details, we understood that you are trying to use ej2-azure-file-provider service for loading your azure blob storage files in EJ2 File Manager. For your convenience, we have prepared an server-side blazor application with File Manager and used the azure file provider service to load file system in the File Manager.

 

Please, download the sample from the below link.

 

Sample: https://www.syncfusion.com/downloads/support/forum/148583/ze/Server-side-blazor-filemanager580481986

 

Note: In Sever side Application, the controller part is not detected. Ensure the below code is available in your startup.cs or else you can add it. 

 

public void ConfigureServices(IServiceCollection services) 

        {                                   

            services.AddCors(c => 

            { 

                c.AddPolicy("AllowOrigin", options => options.AllowAnyOrigin()); 

            }); 

        } 

public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 

        { 

            app.UseCors(options => options.AllowAnyOrigin()); 

            app.UseEndpoints(endpoints => 

            { 

              //Map the controller part 

              endpoints.MapControllers(); 

                endpoints.MapBlazorHub(); 

                endpoints.MapFallbackToPage("/_Host"); 

            }); 

        } 

 

 

In the attached sample, just register your account details and proper blob path details to successfully access your azure blob storage and load the files into the File Manager. For security reasons we have not provided any azure account details in the sample, instead we have commented with precise description which will help you to register your azure account details in the application.

 

Please, let us know if you need any further assistance.

 

Regards,

Shameer Ali Baig S.


SA Saravanan Arumugam replied to Shameer Ali Baig Sulaiman Ali Baig October 30, 2019 10:18 AM UTC

Hi Saravanan,

 

Based on your provided details, we understood that you are trying to use ej2-azure-file-provider service for loading your azure blob storage files in EJ2 File Manager. For your convenience, we have prepared an server-side blazor application with File Manager and used the azure file provider service to load file system in the File Manager.

 

Please, download the sample from the below link.

 

Sample: https://www.syncfusion.com/downloads/support/forum/148583/ze/Server-side-blazor-filemanager580481986

 

Note: In Sever side Application, the controller part is not detected. Ensure the below code is available in your startup.cs or else you can add it. 

 

public void ConfigureServices(IServiceCollection services) 

        {                                   

            services.AddCors(c => 

            { 

                c.AddPolicy("AllowOrigin", options => options.AllowAnyOrigin()); 

            }); 

        } 

public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 

        { 

            app.UseCors(options => options.AllowAnyOrigin()); 

            app.UseEndpoints(endpoints => 

            { 

              //Map the controller part 

              endpoints.MapControllers(); 

                endpoints.MapBlazorHub(); 

                endpoints.MapFallbackToPage("/_Host"); 

            }); 

        } 

 

 

In the attached sample, just register your account details and proper blob path details to successfully access your azure blob storage and load the files into the File Manager. For security reasons we have not provided any azure account details in the sample, instead we have commented with precise description which will help you to register your azure account details in the application.

 

Please, let us know if you need any further assistance.

 

Regards,

Shameer Ali Baig S.

Hi Shameer,

Thanks for the details provided and I am able to show the files of my Azure storage blob in File Manager.

Regards,
Saravanan.A



AB Ashokkumar Balasubramanian Syncfusion Team November 1, 2019 05:19 AM UTC

Hi Saravanan, 
 
We are glad to hear that the problem has been resolved. Please let us know, if you need any further assistance. 
 
Regards, 
Ashokkumar B. 
 


Loader.
Up arrow icon