I need to maintain a F# project. Right now I need to import a C# dll and make use a function in there.
What I have done is that in the F# solution, I have added the C# project, then in the F# project, I have added this new C# project as a reference. The exact step is as follows.
in solution explorer, I have located the F# project. right clicked references, and add reference. Under solution category, I checked the C# project.
After all these steps. my C# project is listed as one of the references in the solution explorer. but it has a yellow triangle with an exclamation mark on it.
In the F# solution file. I have tried the following
open CSV_Reader //this is the project name, and also the namespace
module Stage =
CSV_Reader.Parser.InsertIntoDB(connStr, tableName, csvFilePath)
the compiler is telling me for the 2 occurrences of CSV_Reader
The namespace or module 'CSV_Reader' is not defined
The namespace or module 'CSV_Reader' is not defined
EDIT:
Thanks to the link (likely duplicate) provided by Guy Coder, tt turns out that the problem I am running into is a .net framework mismatch issue. The F# project runs on .net 4 but the C# dll is written in .net 4.5. Therefore when I make a reference to the C# project, there is a yellow triangle with exclamation mark. All i need to do is to modify the C# dll project to use the same version of .net framework as the F# project and the issue is resolved.