OYIon / LiveSharp

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

'AssemblyTimestamp' was not present in the dictionary #73

Open neo210211 opened 4 years ago

neo210211 commented 4 years ago

Hi! I am on the latest version of LiveSharp NuGet v1.5.23 and latest version of the Server App v.1.5.1 for Windows. I am seeing the following error in the Server log. Please help.

14:44:56 Error: Compilation failed:
System.Collections.Generic.KeyNotFoundException: The given key 'AssemblyTimestamp' was not present in the dictionary.
at System.Collections.Generic.Dictionary2.get_Item(TKey key) at LiveSharp.Infrastructure.WorkspaceLoader.GetProjectInfo(String solutionCacheDir, String projectName, Dictionary2 properties)
at LiveSharp.Infrastructure.WorkspaceLoader.GetProjectInfo(String solutionCacheDir, String projectName, String[] projectInfoLines)
at LiveSharp.Infrastructure.WorkspaceLoader.GetWorkspace(String nugetPath, String solutionPath)
at LiveSharp.LiveSharpWorkspace.LoadSolution(String nugetPath, String solutionPath, String projectDir, String projectName, Boolean needWatcherSubscribe)
ionoy commented 4 years ago

@neo210211 did you try restarting Visual Studio / Rider? This seems like the LiveSharp MSBuild task mismatch.

neo210211 commented 4 years ago

I did. It didn't help.

ionoy commented 4 years ago

Do you have LiveSharp installed in multiple projects?

neo210211 commented 4 years ago

Just one project.

After a restart of VS and rebuild, the error no longer appears. However, I am not able to HotReload. Please help.

ionoy commented 4 years ago

Do you see Dashboard starting when your application starts? Do you have the latest NuGet package installed? Also, there might be useful info in the logs at %TEMP%\LiveSharp\server-*.log

neo210211 commented 4 years ago

On the Dashboard:

Title "Messages"

AppTheme xxx.Models.AppTheme

Changing System.Reactive.Linq.ObservableImpl.Cast`2[System.Object,ReactiveUI.IReactivePropertyChangedEventArgs`1[ReactiveUI.IReactiveObject]]

Changed System.Reactive.Linq.ObservableImpl.Cast`2[System.Object,ReactiveUI.IReactivePropertyChangedEventArgs`1[ReactiveUI.IReactiveObject]]

ThrownExceptions ReactiveUI.ScheduledSubject`1[System.Exception]
ionoy commented 4 years ago

Do you see anything in the Output window when you update the file?

neo210211 commented 4 years ago

Nope.

The error on Dashboard appears when my mobile app is launched.

JohnCampionJr commented 4 years ago

I'm having the same exact problem. Plain, starter project. Same error and symptoms as this issue.

ionoy commented 4 years ago

I have published NuGet package 1.5.27, which should fix the issue.

neo210211 commented 4 years ago

I just checked. The latest is 1.5.25. I will check again later for 1.5.27.

ionoy commented 4 years ago

It was probably still publishing. Should be listed now.

neo210211 commented 4 years ago

Just updated NuGet to 1.5.27 and I am using Server App v.1.5.1 for Windows.

After restarting Visual Studio and rebuilding my mobile app after a Clean, I can no longer connect to your Server App -- while Visual Studio output says "LiveSharp Server connected". Please help.

Loaded assembly: /private/var/containers/Bundle/Application/2BD99E55-7EDE-4B8A-8AD5-3D8E43FB223C/QunFa.iOS.app/LiveXaml.Standard.dll [External]
[0:] livesharp: Transport type: LiveSharp.ServerClient.SocketTransport
[0:] livesharp: Connecting to 192.168.68.129:50540
[0:] livesharp: Activating UpdateHandler XamarinFormsUpdateHandler
[0:] livesharp: Activating UpdateHandler XamarinFormsViewHandler
[0:] livesharp: Activating UpdateHandler XamarinFormsViewModelHandler
Thread started: <Thread Pool> #14
Thread started:  #15
Loaded assembly: /private/var/containers/Bundle/Application/2BD99E55-7EDE-4B8A-8AD5-3D8E43FB223C/QunFa.iOS.app/System.Text.RegularExpressions.dll [External]
Thread started:  #16
[0:] livesharp: Connected to 192.168.68.129:50540
[0:] livesharp: LiveSharp Server connected
ionoy commented 4 years ago

Please try the following package LiveSharp.1.5.28.zip

neo210211 commented 4 years ago

Just tried out v1.5.28.

I can now connect to the Server App. However, HotReload is not working. A server-xxx.log file reveals he following error and the Inspector window on Dashboard is blank.

14:56:30 (runtime) LiveSharp Server connected
14:56:31 client connected: 127.0.0.1:55830
14:56:31 Client 127.0.0.1:55830 joined group 7
14:56:31 Client 127.0.0.1:55830 joined group 6
14:56:31 Error: EndReceive failed
System.Xml.XmlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
   at LiveSharp.ServerApp.HostServer.HandleMessage(ServerMessage message) in C:\Projects\LiveSharp\src\LiveSharp.ServerApp\HostServer.cs:line 125
   at LiveSharp.ServerApp.Network.LiveServer.MessageReceived(ServerMessage message, Client client) in C:\Projects\LiveSharp\src\LiveSharp.Server\Network\LiveServer.cs:line 108
   at LiveSharp.ServerClient.MessageParser.Feed(Byte b) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\MessageParser.cs:line 111
   at LiveSharp.ServerClient.ParserBase`1.Feed(Byte[] buffer, Int32 bytesRead) in C:\Projects\LiveSharp\src\LiveSharp.ServerClient\ParserBase.cs:line 20
   at LiveProjectCommon.Server.LiveHost.EndReceive(IAsyncResult ar) in C:\Projects\LiveSharp\src\LiveSharp.Server\Network\LiveHost.cs:line 117
14:56:31 client disconnected: 127.0.0.1:55830
ionoy commented 4 years ago

Here you go. Sorry for spamming you with versions.

LiveSharp.1.5.29.zip

neo210211 commented 4 years ago

With v.1.5.29, HotReload is still not working for me. I encountered the following error in the Inspector window:

LoadCommand Xamarin.Forms.Command

IsBusy False

Title "James xxx (5)"

AppTheme xxx.Models.AppTheme

Changing System.Reactive.Linq.ObservableImpl.Cast`2[System.Object,ReactiveUI.IReactivePropertyChangedEventArgs`1[ReactiveUI.IReactiveObject]]

Changed System.Reactive.Linq.ObservableImpl.Cast`2[System.Object,ReactiveUI.IReactivePropertyChangedEventArgs`1[ReactiveUI.IReactiveObject]]

ThrownExceptions ReactiveUI.ScheduledSubject`1[System.Exception]
ionoy commented 4 years ago

This is not actually an error. Inspector just shows your ViewModel that has these properties in the base class. I guess you are using ReactiveUI, it has ThrownExceptions property which you can subscribe to. Are there any other errors or exceptions? What if you manually switch to another Page and go back?

neo210211 commented 4 years ago

I just checked again. No, there's no other errors or exceptions. Manually switching between pages does not resolve the problem.

Please advise.

JohnCampionJr commented 4 years ago

Same thing with the .29 version, hot reload no longer works. No clues either....