Jump to content

Debugging Server plugin


thejacer87

Recommended Posts

thejacer87

Hey guys,

 

I'm trying to debug my server plugin while developing. What's the recommended way to go? Can I set breakpoints in visual studio somehow? Is there a special emby debug message that will send a message to the browser console?

I'm really struggling here trying to get something, seemingly simple going here. So any help would be appreciated.

 

 

Thanks

Link to comment
Share on other sites

Since your code is in an external .dll, you'll need to use the debugger menu to attach it to the emby server process. i haven't done this in a while. usually logging is sufficient for what i need to debug.

Link to comment
Share on other sites

thejacer87

Since your code is in an external .dll, you'll need to use the debugger menu to attach it to the emby server process. i haven't done this in a while. usually logging is sufficient for what i need to debug.

 Thanks luke,

 

any chance you could help with this error: 

System.IO.FileNotFoundException: Could not load file or assembly 'HtmlAgilityPack, Version=1.5.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a' or one of its dependencies. The system cannot find the file specified.

think i need HtmlAgilityPack to load a schedule for the channel listing for my plugin. Im using nuget to install it. and in the Channel.cs im `using HtmlAgilityPack;` with no issues building it.

 

I really just need to load a json file from a url and loop over it to make the menu items.

 

What would be the best channel plugin to try to look through?

 

Right now I'm following the TuneIn plugin and the use:

using (var site = await _httpClient.Get(url, CancellationToken.None).ConfigureAwait(false))
            {
                page.Load(site, Encoding.UTF8);

where page is a `new HTMLDocument`

 

that might be a little overkill, but i dunno. 

 

also any guidance on what the channeliteminfo needs to look like for a submenu to be possible

Edited by thejacer87
Link to comment
Share on other sites

thejacer87

Embed the whole source code of that rather than trying to load a dll

any resources on how to do this? i've never done any c# or visual studio

 

if i copy the files into the project and try to build the solution i get an error. Something about missing TraceListener.

 

then if i try to embed the directory it won't let me, unlike the config page html.

Edited by thejacer87
Link to comment
Share on other sites

if i copy the files into the project and try to build the solution i get an error. Something about missing TraceListener.

 

This is the correct answer. Just copying the files is enough. Unfortunately I cannot teach you c# and still be able develop Emby, but it's not compiling because the api you're trying to use (TraceListener), is not available in .NET Standard 1.3.

 

So now you're faced with a decision:

I would highly suggest the first option because multi-targeting is a pain in the neck.

Link to comment
Share on other sites

  • 4 months later...

If we about debug on windows, no need to manually attach to the server. 

 

What i done:

- download latest portable emby server

- go to project settings, add post-build event like: 

 

cmd /C del /F "$(SolutionDir)..\embyserver-win-x64-3.2.70.0\programdata\plugins\$(TargetFileName)"

cmd /C copy /Y "$(TargetPath)" "$(SolutionDir)..\embyserver-win-x64-3.2.70.0\programdata\plugins\" 

 

- debug tab, Launch executable - select EmbyServer.exe, working dir - emby root folder

 

 

And with all above i able to debug plugin using F5 and stop directly from IDE.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...