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:

  1. open vs2012
  2. file -> new -> project -> visual c# -> wpf application
  3. right-click references -> manage nuget packages...
  4. add microsoft asp.net web api client libraries searching microsoft.aspnet.webapi.client
  5. right-click project -> properties
  6. click publish tab
  7. uncheck automatically increment revision each publish
  8. click publish now button
  9. 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:

  1. right-click project -> add... -> existing item
  2. browse solutionroot\packages\microsoft.net.http.2.0.20710.0\lib\net40 , select both system.net.http.dll , system.net.http.webrequest.dll
  3. this adds both files 'content' application - warnings (msbuild error msb3178) doesn't appear can it
  4. note when publish, both files in publish\application files\wpfapplication1_1_0_0_0 folder

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -