AvaloniaRider: Plugin dont show my window

Obtaining AppBuilder instance from LStorageAdmin.Program.BuildAvaloniaApp
Initializing application in design mode
Sending StartDesignerSessionMessage
System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Avalonia.Remote.Protocol.BsonStreamTransportConnection.ReadExact(Byte[] buffer) in /_/src/Avalonia.Remote.Protocol/BsonStreamTransport.cs:line 59
   at Avalonia.Remote.Protocol.BsonStreamTransportConnection.Reader() in /_/src/Avalonia.Remote.Protocol/BsonStreamTransport.cs:line 71
Process terminated with exit code 1"C:\Program Files\dotnet\dotnet.exe" exec --runtimeconfig C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.runtimeconfig.json --depsfile C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.deps.json C:\Users\f98f9\.nuget\packages\avalonia\0.10.18\buildTransitive\..\tools\netcoreapp2.0\designer\Avalonia.Designer.HostApp.dll --transport tcp-bson://127.0.0.1:62827/ --method avalonia-remote C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.dll
Obtaining AppBuilder instance from LStorageAdmin.Program.BuildAvaloniaApp
Initializing application in design mode
Sending StartDesignerSessionMessage
System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Avalonia.Remote.Protocol.BsonStreamTransportConnection.ReadExact(Byte[] buffer) in /_/src/Avalonia.Remote.Protocol/BsonStreamTransport.cs:line 59
   at Avalonia.Remote.Protocol.BsonStreamTransportConnection.Reader() in /_/src/Avalonia.Remote.Protocol/BsonStreamTransport.cs:line 71
Process terminated with exit code 1"C:\Program Files\dotnet\dotnet.exe" exec --runtimeconfig C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.runtimeconfig.json --depsfile C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.deps.json C:\Users\f98f9\.nuget\packages\avalonia\0.10.18\buildTransitive\..\tools\netcoreapp2.0\designer\Avalonia.Designer.HostApp.dll --transport tcp-bson://127.0.0.1:62839/ --method avalonia-remote C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.dll
Obtaining AppBuilder instance from LStorageAdmin.Program.BuildAvaloniaApp
Initializing application in design mode
Sending StartDesignerSessionMessage
System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Avalonia.Remote.Protocol.BsonStreamTransportConnection.ReadExact(Byte[] buffer) in /_/src/Avalonia.Remote.Protocol/BsonStreamTransport.cs:line 59
   at Avalonia.Remote.Protocol.BsonStreamTransportConnection.Reader() in /_/src/Avalonia.Remote.Protocol/BsonStreamTransport.cs:line 71
Process terminated with exit code 1"C:\Program Files\dotnet\dotnet.exe" exec --runtimeconfig C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.runtimeconfig.json --depsfile C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.deps.json C:\Users\f98f9\.nuget\packages\avalonia\0.10.18\buildTransitive\..\tools\netcoreapp2.0\designer\Avalonia.Designer.HostApp.dll --transport tcp-bson://127.0.0.1:62850/ --method avalonia-remote C:\Users\f98f9\RiderProjects\LStorage\LStorageAdmin\bin\Debug\net7.0\LStorageAdmin.dll
Obtaining AppBuilder instance from LStorageAdmin.Program.BuildAvaloniaApp
Initializing application in design mode
Sending StartDesignerSessionMessage

My Window xaml

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:viewModels="clr-namespace:LStorageAdmin.ViewModels"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="LStorageAdmin.Views.ProjectInfoWindow"
        Title="ProjectInfoWindow">
    <Design.DataContext>
        <!-- This only sets the DataContext for the previewer in an IDE,
             to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
        <viewModels:ProjectInfoVM/>
    </Design.DataContext>
    <Grid RowDefinitions="Auto, Auto,*" ColumnDefinitions="*,*">
        <TextBlock Grid.ColumnSpan="2" Margin="30" Text="{Binding ProjectName}" HorizontalAlignment="Stretch"></TextBlock>
        <TextBlock Grid.Row="1"  Margin="5" HorizontalAlignment="Stretch">Пользователи в проекте</TextBlock>
        <ItemsRepeater Grid.Row="2"  Margin="10" ScrollViewer.VerticalScrollBarVisibility="Visible" Items="{Binding UsersInProject}">
            <ItemsRepeater.ItemTemplate>
                <DataTemplate>
                    <Border BorderThickness="0,1" BorderBrush="Black" Margin="2">
                        <Grid ColumnDefinitions="Auto,Auto,Auto,*,Auto,Auto">
                            <TextBlock Margin="5" Text="{Binding Name}"></TextBlock>
                            <TextBlock Grid.Column="1" Margin="5" Text="{Binding Role }"></TextBlock>
                            <TextBlock Grid.Column="2" Margin="5" Text="{Binding Email }"></TextBlock>
                            <Button Grid.Column="4" Margin="5" Command="{Binding $parent[Window].DataContext.RemoveUserFromProject}" CommandParameter="{Binding Email}">X</Button>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ItemsRepeater.ItemTemplate>
        </ItemsRepeater>
        <TextBlock Grid.Row="1" Grid.Column="1" Margin="5" HorizontalAlignment="Stretch">Пользователи вне проекта</TextBlock>
        <ItemsRepeater Grid.Row="2" Grid.Column="1" Margin="10" ScrollViewer.VerticalScrollBarVisibility="Visible" Items="{Binding UsersOutOfProject}">
            <ItemsRepeater.ItemTemplate>
                <DataTemplate>
                    <Border BorderThickness="0,1" BorderBrush="Black" Margin="2">
                        <Grid ColumnDefinitions="Auto,Auto,Auto,*,Auto,Auto">
                            <TextBlock Margin="5" Text="{Binding Name}"></TextBlock>
                            <TextBlock Grid.Column="1" Margin="5" Text="{Binding Role }"></TextBlock>
                            <TextBlock Grid.Column="2" Margin="5" Text="{Binding Email }"></TextBlock>
                            <Button Grid.Column="4" Margin="5" Command="{Binding $parent[Window].DataContext.AddUserToProject}" CommandParameter="{Binding Email}"> &lt; </Button>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ItemsRepeater.ItemTemplate>
        </ItemsRepeater>
    </Grid>
</Window>

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 31 (12 by maintainers)

Most upvoted comments

There are still a lot of people reported some random things in the same thread, and I’m still waiting for their answers to distinguish between the issues, open separate issues or diagnose further.

We have already diverged quite a bit from the initial topic of “Plugin dont show my window”, though 😅

@Avabin, I’m sorry but your project isn’t even available now 😦

Sorry, that repo was supposed to be non-public. I will create a small repro project. What I’ve found overall is that previewer might break when complexity increases, like integrating dependency injection and generic host.

I have the same issue with the plugin.

Reproductions steps:

  1. Create an empty project in Rider IDE using Avalonia MVVM app template.
  2. Open MainWindow view.
  3. Open Previewer.
  4. Build the project as previewer asks.
  5. Click update icon in a previewer.
  6. Open previewer console.

Result: System.IO.EndOfStreamException: Attempted to read past the end of the stream. at Avalonia.Remote.Protocol.BsonStreamTransportConnection.ReadExact(Byte[] buffer) at Avalonia.Remote.Protocol.BsonStreamTransportConnection.Reader()

This (I mean, the error message being shown in console) was fixed in 1.2.0 (only Rider 2023.3).

Most likely, all the mentioned problems are not of the plugin but of the previewer, and I report them upstream as I investigate.

Sure, I can share my project! It is still small, and I plan on open sourcing it, so there is no problem.

If it matters my .Net SDK version is 7.0.403, my Rider version is 2023.2.2 and my AvaloniaRider plugin is 1.1.0.

TeamMate.zip

@tastyteadev @CalvinWilkinson, your messages don’t make it clear what the issue is, unfortunately.

Yes, in earlier builds of the plugin, the previewer process was printing a message about closed socket (because the plugin was closing the socket, no less!) during restart.

This wasn’t an error or a problem. Just one program was closing the socket, and another one (Avalonia previewer in this case) decided to print a message about that to the console.

In the modern versions of the plugin, this is no longer the case: according to the advice from the Avalonia team, we force-terminate the previewer process (thanks for mentioning it BTW, I’ll add an entry to the changelog about that).

So, if the previewer was working fine, then I believe this is a duplicate of #270, already fixed logging problem (let’s call it that).

Once the designer trips in a given project, it cannot be brought back. Still can’t put my finger on what is wrong, as designer is working, logs from designer apps are fine (as seen below) but after few hours of code juggling, I’ve accomplished nothing.

Project was created using .NET 7.0.305 and latest Avalonia (11.0.4). image

This is a repo with this bug. Clone and build to see no window in previewer. https://github.com/Avabin/Vizier

Nothing image