I have a WPF application written in C # that cannot publish System.Net.Http.dll and System.Net.Http.WebRequest.dll.
When the user starts the application, he receives an error:
Could not load file or assembly 'System.Net.Http, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file.
To repeat this problem:
- Open VS2012
- File -> Create -> Project -> Visual C # -> WPF Application
- Right Click Links -> NuGet Package Management ...
- Add Microsoft ASP.NET Web API Client Libraries by searching Microsoft.AspNet.WebApi.Client
- Right click project -> Properties
- Click the Publish tab
- Uncheck Automatically increase revision with each publication
- Click Publish Now
- Note that in the
publish\Application Files\WpfApplication1_1_0_0_0 you will see System.Net.Http.Formatting.dll.deploy, but you will not see the other two files: System.Net.Http.dll.deploy or System.Net. Http.WebRequest.dll.deploy.
source share