What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

System.net.Http

PainfulDeath

Member
Joined
Jul 12, 2012
Messages
489
Reaction score
1
Trying to hack some stuff up using the HttpClient class provided in the System.net.Http,
I got the code to compile in Visual Studio, but I had to add an extra reference to the project (System.Net.Http.dll) and it seems that EB doesn't have that assembly (or I am just doing smth wrong), because when I try to load the plugin in the bot following error occures:
Code:
Cannot load [Notifications] because an exception occurred [blablabla\NotificationManager.cs(7,18) : error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
it is pointing at a
Code:
using System.Net.Http;

Doesn't EB have access to that? It's supposed to be in .net 4.6.1 which we are using or?

Please help to understand what I'm doing wrong.
 
Try adding this to one of your source files:

//!CompilerOption|AddRef|System.Net.Http.dll

If that doesn't work, you can specify an absolute path to where it resides on your machine.

Due to post-build protection, normal references that would be loaded are sometimes not if there's no EB specific code that makes use of it, so you have to "help" the code compiler out by adding a reference to it.
 
Torm already told me about the compileroption and it did work fine, thanks though =)
 
Does this also work with like NuGet dll's? I copy the dll to the main folder of the plugin and add //!CompilerOption|AddRef|[NameOfDll].dll to the top of one of the files?
Because I did this and get the error:

Code:
Cannot load [xxxx] because an exception occurred [error CS0006: Metadata file 'xxxx.dll' could not be found
].
System.Exception: error CS0006: Metadata file 'xxxx.dll' could not be found

   at Loki.Bot.ThirdPartyLoader.*‎*‎‪*‎*‬*‫‎‎*‫*​​‫*‪*(Dictionary`2 , String )

It only seems to work when I use the full path of the dll, isn't there a way to fix it without the full path?
 
Last edited:
Does this also work with like NuGet dll's? I copy the dll to the main folder of the plugin and add //!CompilerOption|AddRef|[NameOfDll].dll to the top of one of the files?
Because I did this and get the error:

Code:
Cannot load [xxxx] because an exception occurred [error CS0006: Metadata file 'xxxx.dll' could not be found
].
System.Exception: error CS0006: Metadata file 'xxxx.dll' could not be found

   at Loki.Bot.ThirdPartyLoader.*‎*‎‪*‎*‬*‫‎‎*‫*​​‫*‪*(Dictionary`2 , String )

It only seems to work when I use the full path of the dll, isn't there a way to fix it without the full path?

full path is required when it's something out of the .NET Framework
 
Back
Top