OYIon / LiveSharp

Public repository for the LiveSharp project
96 stars 4 forks source link

Client Blazor System.MissingMethodException get_IsDebugLoggingEnabled #77

Closed valentasm1 closed 4 years ago

valentasm1 commented 4 years ago

I have webassembly blazor later version. I run Visual studio as admin and cmd as admin. No errors in visual studio output, but cmd spits sames errors as browser debug window ( i mean that window from livesharp)

Looks wierd even looks like it detects changes but still error appears again and again. Even i stop solution it still shows error in cmd.

23:50:49.813: Connecting to 127.0.0.1:30540

23:50:49.434: Ended job: Handling Razor update: Pages\StoriesPages\StoryDetailsPage.razor (201)

23:50:49.434: Couldn't find C# code file for Pages\StoriesPages\StoryDetailsPage.razor

23:50:49.232: Starting job: Handling Razor update: Pages\StoriesPages\StoryDetailsPage.razor

23:50:48.802: Connection failed: System.MissingMethodException: Method not found: 'Boolean LiveSharp.ILogger.get_IsDebugLoggingEnabled()'. at LiveSharp.Dashboard.WorkspaceInitializer.b__24_0() at LiveSharp.ServerClient.LiveServerClient.Connect(Action onConnect) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ServerClient.cs:line 63

23:50:48.800: Connected to 127.0.0.1:30540

ionoy commented 4 years ago

This seems like a version conflict between two different versions of LiveSharp. Do you have multiple projects in the solution? Did you try restarting Visual Studio after upgrading the LiveSharp package?

Thanks!

valentasm1 commented 4 years ago

Version conflict of nuget or livesharp server? I had that windows install live sharp I will try cleaning some cache manually. Oh i did many many restarts.

ionoy commented 4 years ago

I mean NuGet package conflicts. You can go to c:\Users\[USER]\.nuget\packages\livesharp\ to see what versions you have installed. You can delete every package except for the latest. And check this folder after the full rebuild if it downloads some older one.

valentasm1 commented 4 years ago

For curiosity i cleared all nuget cache. Created new webassembly blazor solution. Everything looks ok, but just when i start solution same error apears. Maybe i miss smth

Project info

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <RazorLangVersion>3.0</RazorLangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="LiveSharp" Version="1.5.33" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.1.5" />
    <PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
    <PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
  </ItemGroup>

</Project>

Errors in console

C:\Windows\system32>livesharp
LiveSharp: Found available port: 50539
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\HomePC\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:\Windows\system32
Now listening on: https://127.0.0.1:50539
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 39.0401ms 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 16.2682ms 200 application/json
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost.livesharp.net:50539/livesharp?id=FXfqFZpe12ncl9f7Up9oGQ
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="D:\Dev\My\Test\BlazorApp1\BlazorApp1.sln" /ProjectName="BlazorApp1" /ProjectDir="D:\Dev\My\Test\BlazorApp1\BlazorApp1" /NuGetPackagePath="C:\Users\HomePC\.nuget\packages\livesharp\1.5.33\build" /ServerVersion="1.6.0.0"
LiveSharp: (runtime) LiveSharp Server connected
/SolutionPath=D:\Dev\My\Test\BlazorApp1\BlazorApp1.sln
/ProjectName=BlazorApp1
/ProjectDir=D:\Dev\My\Test\BlazorApp1\BlazorApp1
/NuGetPackagePath=C:\Users\HomePC\.nuget\packages\livesharp\1.5.33\build
/ServerVersion=1.6.0.0
dashboard
LiveSharp: Server version: 1.6.0.0
09:43:02.946: Transport type: LiveSharp.ServerClient.SocketTransport
09:43:02.949: Connecting to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:51466
09:43:02.954: Connected to 127.0.0.1:50540
09:43:02.976: Connection failed: System.MissingMethodException: Method not found: 'Boolean LiveSharp.ILogger.get_IsDebugLoggingEnabled()'.
   at LiveSharp.Dashboard.WorkspaceInitializer.<Start>b__24_0()
   at LiveSharp.ServerClient.LiveServerClient.Connect(Action onConnect) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ServerClient.cs:line 63
09:43:03.986: Connecting to 127.0.0.1:50540
09:43:03.987: Connected to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:51468
09:43:03.989: Connection failed: System.MissingMethodException: Method not found: 'Boolean LiveSharp.ILogger.get_IsDebugLoggingEnabled()'.
   at LiveSharp.Dashboard.WorkspaceInitializer.<Start>b__24_0()
   at LiveSharp.ServerClient.LiveServerClient.Connect(Action onConnect) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ServerClient.cs:line 63
09:43:04.533: Workspace loading finished in 1533ms
09:43:04.572: watcher created at D:\Dev\My\Test\BlazorApp1\BlazorApp1\
09:43:04.587: Starting job: Dry run for BlazorApp1
Hosting environment: Production
Content root path: C:\Users\HomePC\.nuget\packages\livesharp\1.5.33\build\Workspace
Now listening on: http://127.0.0.1:51465
Application started. Press Ctrl+C to shut down.
09:43:05.077: Connecting to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:51472
09:43:05.090: Connected to 127.0.0.1:50540
09:43:05.128: Connection failed: System.MissingMethodException: Method not found: 'Boolean LiveSharp.ILogger.get_IsDebugLoggingEnabled()'.
   at LiveSharp.Dashboard.WorkspaceInitializer.<Start>b__24_0()
   at LiveSharp.ServerClient.LiveServerClient.Connect(Action onConnect) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ServerClient.cs:line 63
09:43:06.204: Connecting to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:51476
09:43:06.207: Connected to 127.0.0.1:50540
09:43:06.211: Connection failed: System.MissingMethodException: Method not found: 'Boolean LiveSharp.ILogger.get_IsDebugLoggingEnabled()'.
   at LiveSharp.Dashboard.WorkspaceInitializer.<Start>b__24_0()
   at LiveSharp.ServerClient.LiveServerClient.Connect(Action onConnect) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ServerClient.cs:line 63
09:43:06.307: D:\Dev\My\Test\BlazorApp1\BlazorApp1\Program.cs(18,40): error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)
09:43:06.709: Ended job: Dry run for BlazorApp1 (2121)
09:43:07.223: Connecting to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:51478
09:43:07.226: Connected to 127.0.0.1:50540
09:43:07.229: Connection failed: System.MissingMethodException: Method not found: 'Boolean LiveSharp.ILogger.get_IsDebugLoggingEnabled()'.
   at LiveSharp.Dashboard.WorkspaceInitializer.<Start>b__24_0()
   at LiveSharp.ServerClient.LiveServerClient.Connect(Action onConnect) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ServerClient.cs:line 63
09:43:08.241: Connecting to 127.0.0.1:50540
09:43:08.242: Connected to 127.0.0.1:50540
LiveSharp: client connected: 127.0.0.1:51480

Info from edge console

Debugging hotkey: Shift+Alt+D (when application has focus)
blazor.webassembly.js:1 blazor Loaded 6.46 MB resourcesThis application was built with linking (tree shaking) disabled. Published applications will be significantly smaller.
blazor.webassembly.js:1 Transport type: LiveSharp.Support.Blazor.BlazorTransport
blazor.webassembly.js:1 Connecting to host https://localhost.livesharp.net:50539/livesharp
blazor.webassembly.js:1 Activating UpdateHandler BlazorUpdateHandler
blazor.webassembly.js:1 Blazor update handler started
dotnet.3.2.0.js:1 >>>mono_wasm_get_loaded_files
blazor.webassembly.js:1 Connected to 192.168.42.132:50540
blazor.webassembly.js:1 LiveSharp Server connected
ionoy commented 4 years ago

could you try updating the server?

dotnet tool update livesharp.server --global

valentasm1 commented 4 years ago

I have that though. How server updates. I thought if this guy uses this techniques so maybe there is some method which does. After update i got message and it looks like it is working Tool 'livesharp.server' was successfully updated from version '1.6.0' to version '1.6.2'.

Now it needs some restarts and looks like working. So need to realize working flow.

So how server updates?

ionoy commented 4 years ago

@valentasm1 there is not auto-update functionality yet. I'm not sure it's even possible, to be honest. But I will add a check that will warn the user about an outdated server running. Along with a helpful message on what command to run for the update.