c# - How do you write .Net plugins for NSClient++ -
i've been trying find examples or documentation writing .net plugins nsclient++.
can direct me working sample application or documentation?
i found source code csharpsampleplugin on github. since don't use cmake, made new vs2013 project , added 3 dll's referenced in cmake setup project (google.protocolbuffers.dll
, nscp.core.dll
, , nscp.protobuf.dll
). found dlls in nsclient++ installation dir.
however seems code in sampleplugin.cs doesn't work current dlls. error on line:
response.addlines(plugin.queryresponsemessage.types.response.types.line.createbuilder().setmessage("hello c#").build());
... saying:
error 2 'plugin.queryresponsemessage.types.response' not contain definition 'types' c:\vs_projects\nsclienthelpers\nsclientplugin\sampleplugin.cs 45 74 nsclientplugin error 1 'plugin.queryresponsemessage.types.response.builder' not contain definition 'addlines' , no extension method 'addlines' accepting first argument of type 'plugin.queryresponsemessage.types.response.builder' found (are missing using directive or assembly reference?) c:\vs_projects\nsclienthelpers\nsclientplugin\sampleplugin.cs 45 22 nsclientplugin
so there place can find updated sample plugin or example of how make nsclient++ plugins?
after struggling while rewrote commands 2 standalone executables, irks me couldn't work ;)
i got answer creator of nsclient on serverfault. short answer code in master branch not compatible previous release. after checking out sample code release tag , placing resulting dll in "modules/dotnet" folder, add plugin ini file ...
[/modules] dotnetplugins = 1 [/modules/dotnet] sample=csharpsampleplugin.dll
... , see work nscp test
:
... d core loading plugin: dotnetplugin l webserver port is: 1234 ... check_dotnet d got command: check_dotnet l cli ok: hello c#
Comments
Post a Comment