f# - Unable to reference 'FSharpOption<>' within C# project -


i unable reference fsharpoption<> within c# pcl project targeting xamarin.android within visual studio 2015.

here's video shows steps of me attempting resolve it.

the error receive following:

the type fsharpoption<> defined in assembly not referenced. must add reference assembly

fsharp.core, version=3.7.4.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a

note:

my c# project reference fsharp.core. referencing same fsharp.core version f# projects using:

some_path\packages\fsharp.core.4.0.0.1\lib\portable-net45+monoandroid10+monotouch10+xamarinios10\fsharp.core.dll 

adding app config

the app.config file placed in android client project same app.config file using in test project that's written in f#.

the app.config following:

<?xml version="1.0" encoding="utf-8"?> <configuration>   <runtime>     <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">       <dependentassembly>         <assemblyidentity name="fsharp.core" publickeytoken="b03f5f7f11d50a3a"                           culture="neutral"/>         <bindingredirect oldversion="0.0.0.0-999.999.999.999" newversion="4.4.0.0" />       </dependentassembly>     </assemblybinding>   </runtime> </configuration> 

can provide me guidance on steps required reference fsharp.core functionality within c# project?

updated

i have class references fsharp.core within same c# project:

static class utility {     public static bool issome(this fsharpoption<string> option) => fsharpoption<string>.get_issome(option);     public static bool isnone(this fsharpoption<string> option) => fsharpoption<string>.get_isnone(option); } 

the code above not appear cause compile errors. again, file in same project other file cause errors.

the code causes errors following:

using microsoft.fsharp.core; // . . . if (_viewmodel.familysummary.issome()) { } 

note:
using statement fsharp.core appears ignored.

my viewmodel hosted within f# project inside visual studio.

when run similar issue solution uninstall fsharp.core both projects (the c# , f# one) , install again using nuget package manager solution (not individually each project).

so after removing fsharp.core both go tools > nuget package manager > manage nuget packages solution...

there search fsharp.core, tick projects want add library , select version want add.

that solved issue me.

edit: other thing worth checking library using fsharp.core using same version 1 installed.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -