vb.net - System.Net.Http.Formatting.dll in package Microsoft.AspNet.WebApi.Client 5.2.3. doesn't seem to work -
i have vb.net class library project targeting .net 4.5.1 framework. using visual studio 2013 community edition.
the project library consuming webapi 2 rest api.
as guide using this example.
project's packages.config following:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="microsoft.aspnet.webapi.client" version="5.2.3" targetframework="net451" /> <package id="newtonsoft.json" version="7.0.1" targetframework="net451" /> </packages>
project's assemblies references are:
newtonsoft.json, version=7.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed, processorarchitecture=msil system system.data system.net.http system.net.http.formatting, version=5.2.3.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil <hintpath>..\..\..\..\packages\microsoft.aspnet.webapi.client.5.2.3\lib\net45\system.net.http.formatting.dll</hintpath> system.xml system.core system.xml.linq system.data.datasetextensions
app.config file is:
<?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="newtonsoft.json" publickeytoken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-7.0.0.0" newversion="7.0.0.0" /> </dependentassembly> </assemblybinding> </runtime> <startup><supportedruntime version="v4.0" sku=".netframework,version=v4.5.1" /> </startup> </configuration>
the problem system.net.http.httpclient extensions defined in microsoft.aspnet.webapi.client.5.2.3\lib\net45\system.net.http.formatting.dll aren't loaded functions like
system.net.http.httpclientextensions.postasjsonasync(of t)
and
system.net.http.httpclientextensions.postasxmlasync(of t)
aren't available.
in object browser system.net.http.httpclientextensions class defined in system.net.http.formatting assembly under system.net.http namespace grayed out can see in following screenshot:
i found several related questions this one provided answers , suggestions in comments didn't work me.
i tried several other recommendations various internet sources, example replacing reference of system.net.http.formatting.dll found in microsoft.aspnet.webapi.client package 1 found in extensions assemblies area didn't work either.
now stuck , don't know how solve this. highly appreciated.
edit
it appears grayed out classes in object browser hidden classes (meaning cannot used directly in user's code) , have nothing problem described.
Comments
Post a Comment