I don't think the 'do' code in the module in a file other-than-the-last gets run - try adding a printf. You perhaps want a class with static initialization, which you can refer to to force initialization?

By on 5/24/2010 10:23 AM ()

Thanks Brian. BTW when do the 'do' routine run ? When the first time I reference a value from the module (function/data/etc.) or when I 'open' the namespace ?

Sunit

By on 5/24/2010 11:44 AM ()

See

[link:research.microsoft.com]

for the spec regarding execution of static initializers. Briefly, it runs the first time you access some object with observable initialization. So for instance, if you have

let eval = new obj()in the module, and access TheModule.eval, then the initializer for that module gets run, for example.

By on 5/24/2010 12:05 PM ()

Ok thanks. I'll check it out...meanwhile I tried this to no avail:

module Helpers =
let SP3D_AssemblyResolver() =
do AppDomain.CurrentDomain.add_AssemblyResolve(new ResolveEventHandler(fun _ args ->
try
....
....

[<STAThread>]
do
try
System.Console.Clear();
printfn "Executing..."
do PlantAccess.Helpers.SP3D_AssemblyResolver()
printfn ""

By on 5/24/2010 12:22 PM ()

I would add a printf to the "Helpers", to see if that 'do' is being executed. This way you can decouple the issue of 'is F# running my code' from the issue of 'how AssemblyResolve works' (which I don't know the details of offhand).

By on 5/24/2010 12:40 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper