Closed zielo-it closed 6 years ago
can you share a repo of this?
Hi @zielo-it ! I foud a fix. It seems, that it is problem in System.Net.Http module. You should change in app.config from:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.3" newVersion="4.3.3" />
</dependentAssembly>
to
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
It works for me.
@ThomasPe what do you think about changing return value of Delete function from HttpResponseMessage to bool?
Huh, interesting. I'm ok with changing this to bool since it will throw an exception if anything goes wrong anyway, right?
I see 2 options: 1) throw an exception, when Delete request cannot be execute 2) return not only bool, but bool+string. string - info message. If bool true - info null, if bool false - info contains responce from WP
but it is another BC :( All users must changed there delete method usages
UPD now we already throws exceptions if delete request cannot be execute, so second option cannot be realised
I think I would prefer the first one - do you have a preference?
First option works for me :+1:
I've just updated the NuGet package, should be available in the next hour or so.
@ThomasPe but you didn`t merge this pr #114 . Are you missed it?
oh no, I did o.O give me a sec
Look for version 1.4.2 😉
Problem exists when execution is dealing with
HttpResponseMessage
type. My project uses .NET Framework 4.6.1. When I copied WordpressPCL project into my solution and changedHttpHelper.DeleteRequest
method to returnTask<bool>
instead ofTask<HttpResponseMessage>
code began to work. Otherwise I get followingMissingMethodException
:'System.MissingMethodException : Method not found: 'System.Threading.Tasks.Task'1<System.Net.Http.HttpResponseMessage> WordPressPCL.Client.CustomRequest.Delete(System.String)'.
I've used WordPressPCL v1.4.0