Tuesday, 15 July 2014

web services - F# Web API - Exception has been thrown by the target of an invocation -


Using Owen I am trying to create an F # web service, I have got 2 tutorials online and both of them are giving me the error. The exception of "an appeal is thrown by the exception" on the same line of code, but it does not understand why this is happening

  used server = WebApp. Start & lt; Startup & gt; (BaseAddress)  

Below is a small piece of code. I am using another more complex example forfunandprofit website example number 3 can be found at

 < Code> Namespace FSharpWebAPIOwin Open OVIN Open System. Web. Htp open system.clallions Generic Open Maikrosoftkonkhosting Open Systems Module key = Startup () = Member Yhksng (App: IAppBuilder) = config = new HTTP Configuration () = route to = ConfigkrouteskMapHttpRoute ( "default", "API / {Controller} / {id} ") route Default. Add ("ID", RootPamator. Optional) App. Usweb (config) | & Gt; Neglect type HelloController () = Receive the API Controller () member. () = "Hello" [& lt; EntryPoint & gt;] Main Argument = Enter baseAddress = "http: // localhost: 8000" Use server = WebApp.Start & lt; Startup & gt; (BaseEdrace) console.light line ("press enter to exit ...") console.readline () | & Gt; Ignore 0  

exception details

  system. Reflection. Target Invocation exception was rampant HResult = -2146232828 Message = exception is thrown by the target of an invention Source = mscorlib StackTrace: on System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal on System.RuntimeMethodHandle.InvokeMethod (target object, [] arguments, Signature sig (Object obj, BindingFlags invokeAttr, binder binder, [] parameter), Object Boolean manufacturer object (object obj, object [] parameter, object [] logic) on system .Reflection.RuntimeMethodInfo.Invoke System.Reflection.MethodBase.Invoke , CultureInfo Culture Object) (object obj, object [] Aramitr) on Owin.Loader.DefaultLoader. & Lt; & Gt; C__DisplayClass12. & Lt; MakeDelegate & gt; B__b (IAppBuilder Builder) on Owin.Loader.DefaultLoader & Lt; & Gt; C__DisplayClass1. & Lt; Load emailing & gt; In b__0 (IAppBuilder Builder) on Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp (StartContext reference) Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (StartOptions option) on Microsoft.Owin.Hosting.Starter.HostingStarter.Start Microsoft .Owin.Hosting.Engine.HostingEngine.Start (StartContext reference) tartOptions options) (IServiceProvider services Microsoft.Owin.Hosting.WebApp.StartImplementation on (S, StartOptions options) (StartOptions options Microsoft.Owin.Hosting.WebApp.Start ) Microsoft.Owin.Hosting.WebApp.Start [TStartup] (on StartOptions options) Microsoft.Owin.Hosting.WebApp.Start [TStartup] (string url) [on FSharpWebAPIOwin.main.main (string] argv) in C: \ Users \ amulligan \ Desktop \ API \ ConsoleApplication2 \ ConsoleApplication2 \ Program.fs: Line 30Interception: System.ioFileLoadException HResult = -2146234304 Message = File or Assembly 'System. Web. A clear definition of the assembly located in one of the HTP, version = 5.2.3.0, culture = neutral, Lokkaten = 31bf3856ad364e35 'could not be loaded or its dependency does not match assembly reference. (Exception from HRESULT: 0x80131040) Source = ConsoleApplication2 filename = System.Web.Http, Version = 5.2.3.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 FusionLog ==== Pre-bind state information === LOG: User = CCS \ Amuligon Log: display name = System.Web.Http, version = 5.2.3.0, culture = neutral, public keychain = 31bf3856ad364e35 (fully specified) LOG: Appbase = file: /// C: / user / amulligan / Desktop / API / Console Application 2 / Console Application 2 / Bin / Debug / Log: Initial Private Path = Sh NY Calling assembly: Kansolavedn 2, Version = 0.0.0.0, Culture = neutral, public Ketan = zero. Log: This starts with the default load reference bound. Log: Using the application configuration file: C: \ User \ amulligan \ Desktop \ Api \ ConsoleApplication2 \ ConsoleApplication2 \ bin \ Debug \ ConsoleApplication2.exe.config Log: Using the Host Configuration File: Log: C from the machine configuration file Using: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ config \ machine.config Log: Post-Policy Reference: Systems. Web. Trying to download the new URL file: /// C: / User / Ameligen / Desktop / API / Console Application 2 / ConsoleApplication2 / bin / Debug / PHP / Version / 5.2.3.0, Culture = Neutral, PublicKey Tokens = 31bf3856ad364e35 Log: System.Web.Http.DLL. WRN: Assembly name comparison mismatch: Major version ERR: failed to complete Assembly Setup (HR = 0x80131040) Finish the check on StackTrace: FSharpWebAPIOwin.main.startup. Configuration (IAppBuilder app) InnerException:  


No comments:

Post a Comment