Telegram API issue - Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Steps to reproduce
Compile and produced Telegram.Bot.dll, Telegram.Bot.pdb, Telegram.Bot.xml Load Telegram.Bot.Dll into assembly from powershell, and call sendTextMessage
Expected behavior
Text message is sent
Actual behavior
An error is shown: Exception calling "SendTextMessage" with "4" argument(s): "Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified." At line:3 char:1
- $telegram.SendTextMessage('@someone', 'test api', $false, $false)
-
- CategoryInfo : NotSpecified: (:) [], MethodInvocationException - FullyQualifiedErrorId : FileNotFoundException
Environment data
Powershell 5.1 Windows 10 anniversary update
NuGet Package Version: (e.g. 10.3.0) Unknown
.NET Version: (e.g. 4.6, Core RTM, Mono, etc.) 4.6.1
IDE: (e.g. VS2015, VS Code, etc.) VS2015 community
App: (e.g. Desktop, iOS, Android, etc.) NA
As the error message suggests you also need to load the System.Net.Http.Formatting.dll
@MrRoundRobin Will it make sense for API to check necessary DLLs loaded if not, load them?
This is powershell specific. if you use the nuget package for normal development the dependencies are resolved correctly
@MrRoundRobin Thanks :)
@MrRoundRobin i also getting same issue and i am also adding reference System.Net.Http.Formatting, Version=5.2.3.0. so also then why accure this issue. i have no idea can you please give me some hint