Skip to content

Issue with mono version #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
halcwb opened this issue Jun 9, 2016 · 2 comments
Open

Issue with mono version #8

halcwb opened this issue Jun 9, 2016 · 2 comments

Comments

@halcwb
Copy link

halcwb commented Jun 9, 2016

I have an issue with the mono version used. I get a file not found error in the fsi when I want to use a function that uses another function from a different dll:

$>heroku run bash
- #load "src/Informedica.GenUnit.App/Scripts/load-references-release.fsx";;
[Loading /app/src/Informedica.GenUnit.App/Scripts/load-references-release.fsx]

namespace FSI_0002

> open Informedica.GenUnits.Lib;;
> Api.eval;;
val it : (System.String -> string) = <fun:it@4>
> "200 mg[Mass]" |> Api.eval;;


/app/stdin(0,1): error FS0078: Unable to find the file 'Informedica.GenUtils.Lib
.dll' in any of
 /app/vendor/mono/lib/mono/4.5
 /app/src/Informedica.GenUnit.App/Scripts
 /app
 /app/mono/lib/mono/4.5/


/app/stdin(0,1): error FS0078: Unable to find the file 'Informedica.GenUtils.Lib
.dll' in any of
 /app/vendor/mono/lib/mono/4.5
 /app/src/Informedica.GenUnit.App/Scripts
 /app
 /app/mono/lib/mono/4.5/
System.IO.FileNotFoundException: Could not load file or assembly 'Informedica.Ge
nUtils.Lib, Version=0.4.2.0, Culture=neutral, PublicKeyToken=null' or one of its
 dependencies.
File name: 'Informedica.GenUtils.Lib, Version=0.4.2.0, Culture=neutral, PublicKe
yToken=null'
  at <StartupCode$FSI_0006>.$FSI_0006.main@ () [0x00000] in <filename unknown>:0

  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (Sy
stem.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invoke
Attr, System.Reflection.Binder binder, System.Object[] parameters, System.Global
ization.CultureInfo culture) [0x00000] in <filename unknown>:0
Stopped due to error

However I can open the Informedica.GenUtils.Lib and use any function from that lib directly. This issue doesn't occur in my local mono install. Only in the heroku mono install version.

So, would it be possible that you upgrade your mono builder to a later stable version?

@ademar
Copy link
Member

ademar commented Jun 9, 2016

Do you reference Informedica.GenUtils.Lib.dll in the fsx script ?

#r "pathtodll/Informedica.GenUtils.Lib.dll"

@halcwb
Copy link
Author

halcwb commented Jun 9, 2016

Yes, I do. I have the same setup working on Azure. It also works when I run this on my local windows machine and when I run it under os x, running a different mono version. So, I think it's the mono version. If I wouldn't have referenced Informedica.GenUtils.Lib, I couldn't have run a function from that lib.

You can find my setup in my GenUnitApp repo.

In your demo, it works because you only use a direct reference to suave, and suave itself doesn't have any indirect dependencies outside the GAC. It happens when you call a function from a lib, that itself depends on another lib outside the GAC, i.e. in the packages dir. I also checked in the heroku bash that the lib was indeed in the packages dir. Indeed I can reference it in the fsharpi as I mentionned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants