Closed TimLariviere closed 3 years ago
@Ryan-Palmer-CIT I've duplicated your comment so we can track this. Could you add some context to it, please?
Just checked, both the Android and iOS projects include the HintPath
in the templates.
Sure no problem. I was going to add the issue as requested, sorry I hadn't managed to do it already it's just been a hectic week!
I just looked over the git history. My first commit was a clean Fabulous template installed and working. My second commit updates a few packages. In the iOS project, this caused FSharp.Core to become private. The same did not happen to the Android project.
iOS .fsproj
iOS packages.config
On a side note, updating FSharpCore only updated the 'Update' refs in the core Forms project, ignoring the 'Include' one.
@Ryan-Palmer-CIT I think this issue is solved, right? I tested it and it seems to be fixed.
Maybe, I haven't tried using Fabulous since I wrote this post. Sorry I can't be any more help!
That's not a problem. With the latest version of Fabulous and VS this does not seem to be a problem anymore. I am going to close this.
Hi @SergejDK , sorry to raise this from the dead but I just came back to Fabulous after a few months and had exactly this happen again. It seems it may be Windows related, so if you try to replicate you will need to use that rather than mac OS.
Just create a new Fabulous template project and update FSharp Core, I went to 5.0.2. It should mess up the fsharp refs. You will get an exception saying it can't find a ValueTuple definition in an FSharp 4.7.2 folder. The solution is to open the ios project file and make the replacements tim mentioned in the OP (but with the newer 5.0.2 F# version).
@Ryan-Palmer-CIT I think it's a tooling issue in Visual Studio rather than a Fabulous issue...
We do have the hint path for FSharp.Core correctly declared in the iOS project https://github.com/fsprojects/Fabulous/blob/ebcecbfcfcc598c9e8651b22f02652d2796f6ae6/Fabulous.XamarinForms/templates/content/blank/NewApp.iOS/NewApp.iOS.fsproj#L132-L134
How do you update the FSharp.Core package? Via the NuGet UI in VS?
Does VS replace HintPath
with Private = True
?
One thing that can be a problem with FSharp.Core, is that it's both a NuGet package and a assembly reference coming from the .NET SDK. And that assembly reference is implicitly added to all fsproj, hence why we had to have <PackageReference Update="xxx"/>
instead of just Include
.
Hi Tim! It is the same issue we went over before.
How do you update the FSharp.Core package? Via the NuGet UI in VS? Does VS replace HintPath with Private = True?
Yes and yes.
Maybe the folks at https://github.com/xamarin/xamarin-macios can help fix that behavior?
Do you think it is worth a note in the docs or something? I lost many hours to it and I think it will happen to every Windows VS user!
I think we can include a note on it on this page: https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/dev-pitfalls.html I already added some notes on limitations about IDEs and F# 5.0 in it, so it should be a good place for this.
Ok great - would you like me to add it or would you rather?
It would be great if you could do it :) I'll merge as soon as I have some time.
No problem, thanks for your help :)
I have had the same exception on startup ( Could not load type of field 'Fabulous.ViewElement... Could not resolve type ...'Microsoft.FSharp.Core.FSharpValueOption etc) happen to me a couple of times this week, but on iOS instead. Android has been fine.
In each case I have tracked down the problem to this line in my fsproj:
which needed to be replaced with
Originally posted by @Ryan-Palmer-CIT in https://github.com/fsprojects/Fabulous/issues/385#issuecomment-656587527