F# assembly references causing build issues?

Assuming that there is a typo in your sources as DWright pointed out, I’d say that this error may arise just from the fact that by this code you define a static class MyModuleB with exposed method parameter of an external type MyCsharpType.

This is how the Fsharp code translates to IL (from ILSpy – retranslated to Csharp):

...
public static class MyModuleB
{
    public static string FetchActualResult(MyCSharpType myCSharpType, int id)
    {
        return myCSharpType.Fetch(id);
    }
}

If you don’t expose the type so that it’s statically visible, the error might not appear. This, however, would depend on the implementation of the compiler.

I can imagine, that during compilation of MyModuleA, one configuration of compilation process or version of compiler can try to “touch” MyModuleB, and thus try to reach the unreferenced parameter type, and other might just not touch MyModuleB. It depends.

So the problem seems to me being not in the compilation process, but in the fact, that you expose usage of a type for which you don’t reference its assembly.

Leave a Comment

techhipbettruvabetnorabahisbahis forumueduedueduedueduseduseduedueduedu