delegateas/Daxif

System.MissingMethodException

strwase opened this issue · 4 comments

Hi,

I keep getting this error when I try to run the scripts.
depending on which script, it's a different method being referenced.

I think it has something to do with my F# tools, but seeing as this is my first experience using F#, I have no clue how to resolve this.

Below 2 of the exceptions I'm getting

SolutionExportDev.fsx / CountEntities.fsx

System.MissingMethodException: Method not found: 'Microsoft.FSharp.Core.FSharpOption`1<!!0> Microsoft.FSharp.Collections.SeqModule.TryHead(System.Collections.Generic.IEnumerable`1<!!0>)'.
   at DG.Daxif.Common.CrmDataHelper.retrieveFirstMatch(OrganizationServiceProxy proxy, QueryExpression query)
   at DG.Daxif.Modules.Solution.Versioning.getSolutionVersionNumber(OrganizationServiceProxy proxy, String solutionName)
   at DG.Daxif.Solution.UpdateVersionNumber(Environment env, String solutionName, FSharpOption`1 increment)
   at <StartupCode$FSI_0002>.$FSI_0002.main@() in C:\Users\JST\Documents\Visual Studio 2017\Projects\TcMeetingDemo\TcMeetingDemo\Daxif\SolutionExportDev.fsx:line 16
Stopped due to error

PluginSyncDev.fsx

System.Exception: Failed to fetch plugin configuration from plugin assembly. This error can be caused if an old version of Plugin.cs is used.\nFull Exception: Method not found: '!!0 Microsoft.FSharp.Collections.ArrayModule.Head(!!0[])'.
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1356.Invoke(String message)
   at DG.Daxif.Modules.Plugin.PluginDetection.getPluginsFromAssembly(Assembly asm)
   at DG.Daxif.Modules.Plugin.PluginDetection.getAssemblyContextFromDll(String projectPath, String dllPath, PluginIsolationMode isolationMode, Boolean ignoreOutdatedAssembly)
   at DG.Daxif.Modules.Plugin.MainHelper.loadAndValidateAssembly[a](FSharpFunc`2 proxyGen, String projectPath, String dllPath, PluginIsolationMode isolationMode, Boolean ignoreOutdatedAssembly)
   at DG.Daxif.Modules.Plugin.MainHelper.analyze[a](FSharpFunc`2 proxyGen, String projectPath, String dllPath, String solutionName, PluginIsolationMode isolationMode, Boolean ignoreOutdatedAssembly)
   at DG.Daxif.Modules.Plugin.Main.syncSolution[a](FSharpFunc`2 proxyGen, String projectPath, String dllPath, String solutionName, PluginIsolationMode isolationMode, Boolean ignoreOutdatedAssembly, Boolean dryRun)
   at DG.Daxif.Plugin.Sync(Environment env, String assemblyPath, String projectPath, String solutionName, FSharpOption`1 dryRun, FSharpOption`1 isolationMode, FSharpOption`1 ignoreOutdatedAssembly, FSharpOption`1 logLevel)
   at <StartupCode$FSI_0002>.$FSI_0002.main@() in C:\Users\JST\Documents\Visual Studio 2017\Projects\TcMeetingDemo\TcMeetingDemo\Daxif\PluginSyncDev.fsx:line 11
Stopped due to error

It seems you are running an old version of F# (I interpret it as being version 3). DAXIF requires F# v4.

How are you executing the scripts? I recommend enabling F#-support in Visual Studio 2017, and then using Execute In Interactive (Alt+Enter) directly from the scripts in Visual Studio. The F# Setup-page on the wiki has been updated accordingly.

thank you for the quick reply.
when i run it from vs2017 I get a different error
PluginSyncDev.fsx(14,1): error FS0039: The value, namespace, type or module 'Plugin' is not defined.

Am I still forgetting something?

You need to select the lines you want to execute when using Execute In Interactive (Alt+Enter). I am guessing that you have only selected the last line now.

Could you try Ctrl+A in your script before executing?

now i feel like an idiot :-)
thank you for the help!