Referencing System.Net.Http

May 9, 2016 at 10:08 PM
Edited May 10, 2016 at 2:24 PM
Hi Oleg, I'm trying to reference System.Net.Http.Formatting.dll right now eventhough I have the package Microsoft.AspNet.WebApi.Client.5.2.3, that also add System.Net.Http.Formatting somewhere in the setup it tells me File not found when I run the setup.

How can I reference it ? tryed
...
installerProject.DefaultRefAssemblies.Add(@"System.Net.Http.Formatting.dll") ... It is already added in the wxs file though
<Component Id="Component.System.Net.Http.Formatting.dll" Guid="f72d5c9a-2018-4954-9456-28e7dc69c4f9">
   <File Id="System.Net.Http.Formatting.dll" Source="path\System.Net.Http.Formatting.dll" />
</Component>
May 10, 2016 at 3:02 AM
Hi Khanvo,

You can always add it as a default assembly (as you did) or as an extra parameter in the ManagedAction constructor.

The problem you are experiencing is most likely caused by the candle probing failure. You can try to solve it by playing with the project.SourceBaseDir and of course (as a troubleshooting step) you can always use an absolute path:
installerProject.DefaultRefAssemblies.Add(System.IO.Path.GetFullPath("System.Net.Http.Formatting.dll"));
This way you will clearly see (from wxs) where candle is expecting the assembly to be.
May 10, 2016 at 2:27 PM
Edited May 11, 2016 at 7:53 PM
Thanks, It worked.