You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a F# class library with a literal in it and a C# console application that uses it. When the literal is changed, the F# library is rebuilt, but not the C# project, resulting in printing the wrong value. Also, if the C# project is changed and "rebuilt" (incremental), the old literal is used. Only if you make a clean rebuild, the proper literal value is used.
The F# library:
namespace ClassLibrary
module Literals =
[<Literal>]
let Number = 2048
C# app:
Console.WriteLine($"The number is {ClassLibrary.Literals.Number}");
The output of a clean rebuild is 2048.
When the literal is changed to something else, the output is still 2048.
When the C# project is changed to e.g. print ClassLibrary.Literals.Number + 1, it will print 2049 as if the literal still was 2048.
You need to manually trigger a rebuild (RMB -> Rebuild in VS) or clean the solution to resolve the inconsistency.