Closed CreateLab closed 8 months ago
What does it show instead of your window?
Nothing
Could you please prepare MCVE? I find it difficult to reproduce your setup.
Cant reproduce it in mvp, send info in private contact.
Try to temporarily comment out this block in axaml:
<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>
Reproduces with bulit-in template on avalonia 11.0.2 and .net 7.0.200 Steps to reproduce:
dotnet new install Avalonia.Templates
dotnet build
Before click on "Start previewer" there's still "Application can't be previewed in design view" but only part of logs up to "Sending StartDesignerSessionMessage"
@1MrEnot, in your case, I see that the preview works correctly.
Do I understand correctly, that these sample apps won't be displayed in preview and it is ok?
@1MrEnot you are missing the point. Previewer will gladly display windows and views, but not 'App' object, as stated in error message. Open any Window or view and see if it displays it or not.
Second. I have the same kind of bug as poster and I'm trying to reproduce his bug in a side project. This is non trivial.
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).
This is a repo with this bug. Clone and build to see no window in previewer. https://github.com/Avabin/Vizier
I have the same issue with the plugin.
Reproductions steps:
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()
I am getting this issue as well just like @tastytea-dev mentioned above.
I get the error EndOfStreamException
in the log as well whether the previewer is correctly rendering the control and/or window or not.
@CreateLab, unfortunately, I cannot build your project. You only shared one .csproj
of, I assume, several ones.
Please provide a better example to reproduce. Without it, I can't improve anything.
@Avabin, I'm sorry but your project isn't even available now :(
@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).
@ForNeVeR I have almost the exact same issue. I have tried:
The error pops before any of the constructors are hit and before the BuildAvaloniaApp
method is called inside the Program
class.
Here is the same screenshot as above:
Please let me know if I can provide any more info.
@DefinitelyADev, a solution where this reproduces would be ideal.
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
.
@ForNeVeR I forgot to mention. The steps to replicate the error are:
.axaml
files (I used MainWindow.axaml).@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.
Most likely, all the mentioned problems are not of the plugin but of the previewer, and I report them upstream as I investigate.
@DefinitelyADev, could you please clarify what is the issue? I have done the actions you've asked, and I see the preview. Before of after I press the Reload button, it just seems to work.
(not sure how much of your UI I am allowed to publicly share, so I'll only show the header of the panel, to demonstrate the plugin UI state)
What do you see in your case?
@ForNeVeR the previewer works but if you look at the console it shows an EndOfStreamException
@DefinitelyADev, what plugin version do you use?
@DefinitelyADev, what plugin version do you use?
I have the same issue.
Plugin Version: v1.1.0 Rider Info:
JetBrains Rider 2023.2.1
Build #RD-232.9559.61, built on August 22, 2023
Licensed to Calvin Wilkinson
Subscription is active until May 19, 2024.
Runtime version: 17.0.8+7-b1000.8 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
.NET Core v7.0.7 x64 (Server GC)
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 20
Registry:
editor.focus.mode.color.light=6a737d
ide.editor.tab.selection.animation=true
ide.animate.toolwindows=true
documentation.show.toolbar=true
ide.new.editor.tabs.vertical.borders=true
ide.experimental.ui=true
ide.balloon.shadow.size=0
editor.focus.mode.color.dark=6a737d
vcs.empty.toolwindow.show=false
ide.new.project.model.index.case.sensitivity=true
database.show.search.tab=false
Non-Bundled Plugins:
GLSL (1.24)
com.intellij.javafx (1.0.4)
com.villains.intelij.plugin.newoceantheme (1.2.2)
com.jetbrains.darkPurpleTheme (1.3)
com.github.copilot (1.4.0.3748)
avalonia-rider (1.1.0)
com.jetbrains.rider.android (232.9559.61)
nsubstitutecomplete-rider (1.10.0)
com.markskelton.one-dark-theme (5.9.0)
fr.socolin.application-insights-debug-log-viewer (1.9.0)
me.seclerp.rider.plugins.monogame (232.0.0-rc1)
Abc.MoqComplete.Rider (2023.2.0.1)
com.intellij.plugin.adernov.powershell (2.3.0)
com.chrisrm.idea.MaterialThemeUI (8.12.6)
org.sonarlint.idea (10.0.1.77000)
com.mallowigi (93.1.0)
This (I mean, the error message being shown in console) was fixed in 1.2.0 (only Rider 2023.3).
This (I mean, the error message being shown in console) was fixed in 1.2.0 (only Rider 2023.3).
Ok, np. 😀 I will wait until 2023.3 is fully released and I will take advantage of the plugin update then. Thanks for your help and for fixing the issue!!
@ForNeVeR my plugin version is 1.1.0, as I mentioned in a previous comment. I will try it during the weekend with EAP version of rider and get back to you. Thanks!
@ForNeVeR seems to be fixed. I think you can close the issue. Checked with Rider version 2023.3 EAP 7
and AvaloniaRider Plugin version 1.3.0
.
Thank you for your time!
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 😅
This issue was closed because it has been open for 14 days, but no requested information was received. Please leave a comment if you think this is a mistake.
My Window xaml