Oldrich Svec
Oldrich Svec

Reputation: 4231

Type reference error using F# interactive

I have a solution consisting of 2 projects:

I create a fsx file containing:

 #r @".\bin\Release\LBM.dll"
 #r @".\bin\Release\Utilities.dll"
 LBM.displayMyMatlab()

and I get following error:

Microsoft (R) F# 2.0 Interactive build 4.0.30319.1
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> 

--> Referenced 'D:\Olda\Bak\Projects\LBM\OldaConsortium\bin\Release\LBM.dll'


--> Referenced 'D:\Olda\Bak\Projects\LBM\OldaConsortium\bin\Release\Utilities.dll'



Lars_Slump_Post.fsx(45,21): error FS0074: The type referenced through 'Utilities.Matlab' is defined in an assembly that is not referenced. You must add a reference to assembly 'Utilities'.
> 

What does it mean? When I do the same using an ordinary compiled project, it works just fine. Any help appreciated!

Upvotes: 2

Views: 651

Answers (1)

Robert Jeppesen
Robert Jeppesen

Reputation: 7877

Tomas Petricek answered a similar question here: Using COM DLLs with FSI

I'm guessing you need to reference the generated wrapper dll before referencing your own dlls. The generated wrapper is normally named 'Interop.LibName.dll', in your bin folder.

Upvotes: 2

Related Questions