wpf - Why does publish fail to publish System.Net.Http.dll? -
i have wpf application written in c# failing publish system.net.http.dll , system.net.http.webrequest.dll.
when user launches application receive error:
could not load file or assembly 'system.net.http, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. system cannot find file specified.
to replicate issue:
- open vs2012
- file -> new -> project -> visual c# -> wpf application
- right-click references -> manage nuget packages...
- add microsoft asp.net web api client libraries searching microsoft.aspnet.webapi.client
- right-click project -> properties
- click publish tab
- uncheck automatically increment revision each publish
- click publish now button
- note in
publish\application files\wpfapplication1_1_0_0_0
folder see system.net.http.formatting.dll.deploy won't see other 2 files, system.net.http.dll.deploy or system.net.http.webrequest.dll.deploy.
work-around
for now, i've included binaries @ project root. smells, have until better solution comes around.
steps work-around:
- right-click project -> add... -> existing item
- browse
solutionroot\packages\microsoft.net.http.2.0.20710.0\lib\net40
, select both system.net.http.dll , system.net.http.webrequest.dll - this adds both files 'content' application - warnings (msbuild error msb3178) doesn't appear can it
- note when publish, both files in
publish\application files\wpfapplication1_1_0_0_0
folder
Comments
Post a Comment