thejacer87 9 Posted September 28, 2017 Share Posted September 28, 2017 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 More sharing options...
Luke 37186 Posted September 28, 2017 Share Posted September 28, 2017 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 More sharing options...
thejacer87 9 Posted September 28, 2017 Author Share Posted September 28, 2017 (edited) 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. I 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 September 28, 2017 by thejacer87 Link to comment Share on other sites More sharing options...
Luke 37186 Posted September 28, 2017 Share Posted September 28, 2017 Embed the whole source code of that rather than trying to load a dll Link to comment Share on other sites More sharing options...
thejacer87 9 Posted September 29, 2017 Author Share Posted September 29, 2017 (edited) 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 September 29, 2017 by thejacer87 Link to comment Share on other sites More sharing options...
Luke 37186 Posted September 29, 2017 Share Posted September 29, 2017 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: Remove or rewrite the code that won't compile so that it uses API's that are available in .NET standard 1.3 Use the multi-targeting approach that I've documented here: https://github.com/MediaBrowser/Emby/wiki/How-to-build-a-Server-Plugin I would highly suggest the first option because multi-targeting is a pain in the neck. Link to comment Share on other sites More sharing options...
Simca 1 Posted February 13, 2018 Share Posted February 13, 2018 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. 1 Link to comment Share on other sites More sharing options...
Luke 37186 Posted February 13, 2018 Share Posted February 13, 2018 Excellent, thanks for the info ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now