Skip to content

BogdanBabiy/binoculars

 
 

Repository files navigation

readme

This is a quick project to test how dotnet watch works in order to determine whether it would be a good candidate for code hot swapping. Sample usage: https://docs.microsoft.com/en-us/aspnet/core/tutorials/dotnet-watch?view=aspnetcore-6.0

Tu run:

dotnet watch run --project BinocularsHost/BinocularsHost.fsproj

conclusion

The tool is not for hot-swapping dependencies written in F#. It does however works correctly for C# code. Further explanation:

  1. C# host + F# library: cold swap
  2. C# host + C# library: hot swap
  3. F# host + F# library: cold swap

illustrations

C# host + F# library or F# host + F# library:

watch : Started
0.      PID: 3798 - Hello, Piotr!
1.      PID: 3798 - Hello, Piotr!
watch : File changed: /Users/justpi01/Documents/code/binoculars/BinocularsLib/Library.fs.
watch : Do you want to restart your app - Yes (y) / No (n) / Always (a) / Never (v)?
2.      PID: 3798 - Hello, Piotr!
3.      PID: 3798 - Hello, Piotr!
4.      PID: 3798 - Hello, Piotr!
watch : Hot reload suspended. To continue hot reload, press "Ctrl + R".
5.      PID: 3798 - Hello, Piotr!
watch : Building...
  BinocularsLib -> /Users/justpi01/Documents/code/binoculars/BinocularsLib/bin/Debug/net6.0/BinocularsLib.dll
  BinocularsHostCS1 -> /Users/justpi01/Documents/code/binoculars/BinocularsHostCS1/bin/Debug/net6.0/BinocularsHostCS1.dll
watch : Started
0.      PID: 3817 - Hello, Piotr!!
1.      PID: 3817 - Hello, Piotr!!
2.      PID: 3817 - Hello, Piotr!!

C# host + C# library:

watch : Started
0.      PID: 3503 - Hello, Piotr!!
1.      PID: 3503 - Hello, Piotr!!
watch : File changed: /Users/justpi01/Documents/code/binoculars/BinocularsLibCS/Library.cs.
2.      PID: 3503 - Hello, Piotr!!
3.      PID: 3503 - Hello, Piotr!!
4.      PID: 3503 - Hello, Piotr!!
watch : Hot reload of changes succeeded.
5.      PID: 3503 - Hello, Piotr!
6.      PID: 3503 - Hello, Piotr!
7.      PID: 3503 - Hello, Piotr!
8.      PID: 3503 - Hello, Piotr!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 55.1%
  • F# 30.5%
  • Shell 14.4%