Hang then Exception thrown with Blazor (Blazorise) FileEdit and FilePicker controls
<Field>
<FileEdit Changed="OnFileUpload" />
</Field>
using Blazorise;
using System.IO;
using System.Threading.Tasks;
using System;
namespace BookStoreV7.Blazor.Pages;
public partial class Index
{
async Task OnFileUpload(FileChangedEventArgs e)
{
try
{
if (e.Files.Length > 0)
{
var file = e.Files[0];
using var memoryStream = new MemoryStream();
// Next statement hangs, then throws exception
await file.OpenReadStream(int.MaxValue).CopyToAsync(memoryStream);
}
}
catch (Exception ex)
{
//Console.WriteLine(ex.Message);
}
finally
{
this.StateHasChanged();
}
}
}
await file.OpenReadStream(int.MaxValue).CopyToAsync(memoryStream);
I can confirm that the FileEdit (and FilePicker) control works in a .Net 7, non ABP Blazor Server app i.e. adding Blazorise to it as detailed here: Blazorise Quick Start Guid It seems to be related to the underlying FileEntry.OpenReadStream() when used in an ABP 7.0.0-rc.2 project.
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result) at System.IO.Pipelines.Pipe.GetReadAsyncResult() at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult() at System.IO.Pipelines.PipeReaderStream.<ReadAsyncInternal>d__30.MoveNext() at System.Threading.Tasks.ValueTask`1.get_Result() at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult() at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSDataStream.<ReadAsync>d__36.MoveNext() at System.Threading.Tasks.ValueTask`1.get_Result() at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult() at Blazorise.RemoteFileEntryStream.<CopyFileDataIntoBuffer>d__13.MoveNext() at System.Threading.Tasks.ValueTask`1.get_Result() at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult() at Blazorise.RemoteFileEntryStream.<ReadAsync>d__15.MoveNext() at System.IO.Stream.<<CopyToAsync>g__Core|27_0>d.MoveNext() at BookStoreV7.Blazor.Pages.Index.<OnFileUpload>d__0.MoveNext() in C:\Users\Moor Deybe\source\My Stuff\ABPStuff\ABPV7-BookStore\src\BookStoreV7.Blazor\Pages\Index.razor.cs:line 20
We're currently evaluating a Team licence of abp Commercial.
We find the multi tenancy feature very useful, but regarding the login dialog, we'd like to know if we can switch off/hide the Tenant input field during login? e.g. can we hide this
to achieve the same look and feel as the dialog appears when MultiTenancy is disabled? e.g.
Asking our users for a tenant name would confuse them no end, as we'd like to just set that ourselves in code after login based upon their TenantId in the corresponding entry for that user in the dbo.AbpUsers table.
We're aware of this example of customising the login dialog Community Post Example
which provides this:
and we have examined this "post" on the subject; https://github.com/abpframework/abp/issues/3752
Q. Can we switch off the input field on the dialog when MultiTenancy is enabled and then set the "current tenant" using a CurrentUserTenantResolveContributor of some sort, or would we need to alter the abp source code as described in the community post above, which we prefer not to do?
We're intending to target blazor-server in case that is relevant.