C# – F# declared namespace is not available in the c# project or visible through the object browser

%fcinteropresharper

F# declared namespace is not available in the c# project or visible through the object browser.

I have built a normal F# library project, but even after i build the project and reference it to my C# project, I am unable to access the desired namespace.

I am also unable to see it in the object browser, i get an error telling me that it has not been built. I am running on the september release can someone point out my error ?

F# Version 1.9.6.0

(6) Edit : Referencing the dll directly has fixed my problem, referencing the project allows me to compile but the intellisence does not work. When the dll is directly referenced the intellisence works perfectly.


This is the code found in the .fs file

#light

namespace Soilsiu.Core 

module public Process =
    open System.Xml.Linq

    let private xname (tag:string) = XName.Get(tag)
    let private tagUrl (tag:XElement) = let attribute = tag.Attribute(xname "href")
                                        attribute.Value
    let Bookmarks(xmlFile:string) = 
        let xml = XDocument.Load(xmlFile)
        xml.Elements <| xname "A" |> Seq.map(tagUrl)

    let PrintBookmarks (xmlFile:string) =     
        let list = Bookmarks(xmlFile)
        list |> Seq.iter(fun u -> printfn "%s" u)

(5) Edit : Could ReSharper 4.0 be the problem?

(4) Edit : When i say the Object browser is unable to read the resulting assembly, i mean that when I try to open the assembly in the object browser i get an error telling me the project has not yet been built. yet again i can read the assembly using reflector.

(3) Edit : Reflector can Disassemble the dll but the Object Browser is unable to read it.

(2) Edit : I have Upgraded my F# version to 1.9.6.2 and still the same consequence

(1) Edit : I was able to Disassemble the dll to C# I get : (Everything seems to be fine here)

namespace Soilsiu.Core
{
    [CompilationMapping(7)]
    public static class Crawler

    [CompilationMapping(7)]
    public static class Process
}

[CompilationMapping(7)]
public static class Process
{
    // Methods
    static Process();
    public static IEnumerable<string> Bookmarks(string xmlFile);
    public static void PrintBookmarks(string xmlFile);
    internal static string tagUrl(XElement tag);
    internal static XName xname(string tag);

    // Nested Types
    [Serializable]
    internal class clo@13 : FastFunc<XElement, string>
    {
        // Methods
        public clo@13();
        public override string Invoke(XElement tag@9);
    }

    [Serializable]
    internal class clo@17 : FastFunc<string, Unit>
    {
        // Methods
        public clo@17();
        public override Unit Invoke(string u);
    }
}

Best Answer

What if you reference the produced DLL directly (i.e., not via a project reference, but via a file reference)?

Related Topic