AvaloniaUI / Avalonia.Markup.Declarative

Provides helpers for declarative ui in C#
372 stars 21 forks source link

dotnet watch not working with net 7.0 #23

Closed ivanjx closed 1 year ago

ivanjx commented 1 year ago

i cloned the repo and tried to run the AvaloniaMarkupSample with dotnet watch. i also changed the global.json to use 7.0.100.

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.RuntimeAssembly.GetType(QCallAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive, ObjectHandleOnStack assemblyLoadContext)
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
   at System.StartupHookProvider.CallStartupHook(StartupHookNameOrPath startupHook)
   at System.StartupHookProvider.ProcessStartupHooks()
ivanjx commented 1 year ago

works fine with the latest sdk version 6.0.403

gritsenko commented 1 year ago

Just tried to reproduce on my machine and it works fine

image

take a look on this commt: https://github.com/AvaloniaUI/Avalonia.Markup.Declarative/compare/master...net7

ivanjx commented 1 year ago

yes it works if it is upgraded to net 7

ivanjx commented 1 year ago

is it always required to match the net version for hot reload to work though?

gritsenko commented 1 year ago

is it always required to match the net version for hot reload to work though?

probably. I'm not sue if we can do anything with that behavior