I need to create a new web servce instead of ASMX for WinForms client, working on .NET 4.0. The client can not use nothing except .NET 4.0, because is must support Windows XP. For now I have found stub generators for Web Api, but they must be based on .NET 4.5 that is unacceptable. For now I see just WCF service as a solution, but WCF now is obsolete.
Asked
Active
Viewed 50 times
0
-
Goryachev - couldn't you have/run your webservice on a server with latest .NET installed, and just have client connect to it remotely? – yob Oct 14 '19 at 14:21
-
I agree with @yob. It doesn't sound like your server is restricted to XP, so just make your API .NET 4.5 (or newer) and just call it with your older clients. Here's a post on how to do that (it's for 3.5, but still applies): https://stackoverflow.com/questions/22397865/call-web-apis-in-c-sharp-using-net-framework-3-5 – Broots Waymb Oct 14 '19 at 14:37
-
Thanks, I see that such possibility exists, but I am looking for a solution with automated client stubs generation which works using .net 4.0. – Evgeny Goryachev Oct 15 '19 at 10:29
-
solved! it is possible to define .net version for the generator java -jar swagger-codegen-cli-2.2.1.jar generate -i swagger.json -l csharp -o . --additional-properties packageName=WebApiClient,targetFramework=v3.5,optionalProjectFile=false,optionalAssemblyInfo=false,sourceFolder=. – Evgeny Goryachev Oct 18 '19 at 12:01