Closed warappa closed 1 year ago
OK, it seems like the issue is fixed. I had to do a pretty major rewrite, which honestly was a long time coming.
Here is a build you can try: LiveSharp.1.6.34.zip
Thanks @ionoy !
My observations:
DeserializeTypes(...)
or the like) 🥇 Microsoft.JSInterop.WebAssembly
error "incorrectly aligned or overlapped by a non-object field" (s.b.)LiveSharp: Found available port: 50539
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\spoil\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
LiveSharp: Initializing LiveHost at 50540
LiveSharp: Listening on port 50540 starting
LiveSharp: Listening on port 50540 started
Hosting environment: Production
Content root path: C:\Users\spoil
Now listening on: https://127.0.0.1:50539
Application started. Press Ctrl+C to shut down.
Welcome to LiveSharp!
Documentation https://www.livesharp.net/help/
Live support https://gitter.im/LiveSharp/Lobby (@ionoy)
Server app releases https://github.com/OYIon/LiveSharp/releases
License purchasing https://www.livesharp.net/#licensing
Log files locations are %TEMP%\LiveSharp on Windows and $TMPDIR/LiveSharp on OSX
1) Make sure 'LiveSharp' package is installed in the main project (the one with Program.Main or App.Initialize)
Also install 'LiveSharp' into other projects that should be hot-reloadable
2) Run the application
If nothing appears here after application has started, check the debugging Output window for 'livesharp: ' messages
LiveSharp: client connected: 192.168.0.13:56405
LiveSharp: Client joined group 1
LiveSharp: Client joined group 4
LiveSharp: Starting dashboard process with arguments: /SolutionPath="E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\RepoLiveSharpUpdateFailsWithMatBlazor.sln" /ProjectName="RepoLiveSharpUpdateFailsWithMatBlazor.Server" /ProjectDir="E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\Server" /NuGetPackagePath="C:\Users\spoil\.nuget\packages\livesharp\1.6.36\build" /ServerVersion="1.6.7.0"
17:29:53.530: Transport type: LiveSharp.ServerClient.SocketTransport
17:29:53.539: Connecting to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:56408
17:29:53.544: Connected to 127.0.0.1:50540
LiveSharp: Client joined group 7
17:29:53.557: Dashboard connected to the host
LiveSharp: Client joined group 6
LiveSharp: Client joined group 5
17:29:56.985: Workspace loading finished in 3419ms
17:29:57.050: watcher created at E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\Client\
17:29:57.063: watcher created at E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\Server\
17:29:57.069: Starting job: Dry run for RepoLiveSharpUpdateFailsWithMatBlazor.Server
server: 1.6.7.0
nuget: 1.6.36
Hosting environment: Production
Content root path: C:\Users\spoil\.nuget\packages\livesharp\1.6.36\build\Workspace
Now listening on: http://127.0.0.1:56407
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 OPTIONS https://localhost.livesharp.net:50539/livesharp/negotiate?negotiateVersion=1
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 42.1075ms 204
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST https://localhost.livesharp.net:50539/livesharp/negotiate?negotiateVersion=1 0
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/livesharp/negotiate'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/livesharp/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 21.0867ms 200 application/json
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET https://localhost.livesharp.net:50539/livesharp?id=yRqrsfxE8hEuKNjIxc5qGg
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/livesharp'
LiveSharp: Starting dashboard process with arguments: /SolutionPath="E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\RepoLiveSharpUpdateFailsWithMatBlazor.sln" /ProjectName="RepoLiveSharpUpdateFailsWithMatBlazor.Client" /ProjectDir="E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\Client" /NuGetPackagePath="C:\Users\spoil\.nuget\packages\livesharp\1.6.36\build" /ServerVersion="1.6.7.0"
LiveSharp: Error: EndReceive failed
System.Net.Sockets.SocketException (10054): Eine vorhandene Verbindung wurde vom Remotehost geschlossen.
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at LiveSharp.Server.Network.LiveHost.EndReceive(IAsyncResult ar) in C:\Projects\LiveSharp\src\LiveSharp.Server.Common\Network\LiveHost.cs:line 85
LiveSharp: client disconnected: 127.0.0.1:56408
17:30:01.115: Transport type: LiveSharp.ServerClient.SocketTransport
17:30:01.121: Connecting to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:56429
17:30:01.127: Connected to 127.0.0.1:50540
LiveSharp: Client joined group 7
LiveSharp: Client joined group 6
17:30:01.139: Dashboard connected to the host
LiveSharp: Client joined group 5
17:30:03.500: Workspace loading finished in 2356ms
17:30:03.561: watcher created at E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\Client\
17:30:03.573: watcher created at E:\Programmieren\RepoLiveSharpUpdateFailsWithMatBlazor\Server\
17:30:03.579: Starting job: Dry run for RepoLiveSharpUpdateFailsWithMatBlazor.Client
server: 1.6.7.0
Hosting environment: Production
nuget: 1.6.36
Content root path: C:\Users\spoil\.nuget\packages\livesharp\1.6.36\build\Workspace
Now listening on: http://127.0.0.1:56428
Application started. Press Ctrl+C to shut down.
17:30:08.106: Ended job: Dry run for RepoLiveSharpUpdateFailsWithMatBlazor.Client (4526)
17:32:01.414: Starting job: Handling Razor update: Pages\Index.razor
17:32:01.606: Updating obj\Debug\net5.0\Razor\Pages\Index.razor.g.cs
17:32:01.708: Ended job: Handling Razor update: Pages\Index.razor (290)
17:32:01.725: Received C# update
...
...
Application started. Press Ctrl+C to shut down.
17:30:08.106: Ended job: Dry run for RepoLiveSharpUpdateFailsWithMatBlazor.Client (4526)
17:32:01.414: Starting job: Handling Razor update: Pages\Index.razor
17:32:01.606: Updating obj\Debug\net5.0\Razor\Pages\Index.razor.g.cs
17:32:01.708: Ended job: Handling Razor update: Pages\Index.razor (290)
17:32:01.725: Received C# update
17:32:02.294: warning: ReflectionTypeLoadException Microsoft.JSInterop.WebAssembly, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60: Unable to load one or more of the requested types.
Generic method or method in generic class is internal call, PInvoke, or is defined in a COM Import class.
Could not load type 'WebAssembly.JSInterop.JSCallInfo' from assembly 'Microsoft.JSInterop.WebAssembly, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' because it contains an object field at offset 4 that is incorrectly aligned or overlapped by a non-object field.
17:32:02.333: Received update for field Index.<Test>k__BackingField
17:32:02.335: Received update for field Index+<>c.<>9__13_0
17:32:02.337: Received update for field Index+<>c.<>9__13_1
17:32:02.339: Received update for field Index+<OnInitializedAsync>d__13.<>1__state
17:32:02.341: Received update for field Index+<OnInitializedAsync>d__13.<>t__builder
17:32:02.342: Received update for field Index+<OnInitializedAsync>d__13.<>4__this
17:32:02.343: Received update for field Index+<OnInitializedAsync>d__13.<assemblies>5__1
17:32:02.344: Received update for field Index+<OnInitializedAsync>d__13.<assemblyInfos>5__2
17:32:02.346: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index.get_Test
17:32:02.347: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index.set_Test
17:32:02.348: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index.OnInitializedAsync
17:32:02.349: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index+<>c.<OnInitializedAsync>b__13_0
17:32:02.350: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index+<>c.<OnInitializedAsync>b__13_1
17:32:02.350: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index+<OnInitializedAsync>d__13..ctor
17:32:02.351: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index+<OnInitializedAsync>d__13.MoveNext
17:32:02.351: Received update for method RepoLiveSharpUpdateFailsWithMatBlazor.Client.Pages.Index+<OnInitializedAsync>d__13.SetStateMachine
17:32:02.351: Received update for property Index.Test
Same with adding a parameter and starting to use it in another component.
[Parameter] public string Name {get;set;}
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Object of type 'Append.Blazor.Components.Component1' does not have a property matching the name 'Middlename'.
Afterwards the livesharp crashes:
System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it.
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at LiveSharp.Dashboard.WorkspaceInitializer.CheckForNuGetUpdates()
have the same issue too, livesharp works on C# classes (wasm), however when I switch to razor files and my file contains @click=(args => SomeAction()) hot reload stops work
@dpozimski It looks like this issue i had lately: https://github.com/OYIon/LiveSharp/issues/117
Solution: Update to version 2.0.13 (only available in Gitter chat https://gitter.im/LiveSharp/lobby). Don't forget to update the server tool also - 2.0.6 I think.
Problem
If I add a property to my razor file the updates breaks.
Repo
https://github.com/warappa/RepoLiveSharpUpdateFailsWithMatBlazor/tree/add-property-breaks-updates Branch:
add-property-breaks-updates
Prerequisites
Steps
C:\Users\<username>\.nuget\packages\livesharp\1.6.33
%Temp%\LiveSharp
git clean -fdx
on checked out repoRepoLiveSharpUpdateFailsWithMatBlazor.Server
as Startup ProjectIndex.razor
underAssemblyString
insertpublic string Test { get; set; }
and saveWithout this tiny change i.e. duplicating
SurveyPrompt
or removingSurveyPrompt
works flawlessly.Extra
If you use the steps above and instead of adding
Test
property you replace the whole page with the following content, you get anIL Compilation failed
error:Content
Exception
I think they are releated so I post those 2 issues together.
This issues cause my work on my regular project to be really "difficult" if you understand what I mean :)