NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 3 4 5 6 7 … 93 Next »
Need help using NUtility.dll

 
  • 0 Vote(s) - 0 Average
Need help using NUtility.dll
drmargarit
Offline

Member

Posts: 184
Threads: 49
Joined: Sep 2013
#1
2015-10-02, 02:17 AM
I have a reference to NUtility.dll (c:\program files (x86)\npvr\nutility.dll)
It compiles.

Running it gives this error:

Could not load type 'NUtility.Channel' from assembly 'Nutility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Code:
using NUtility;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DateTime start = DateTime.Now;
            DateTime end = new DateTime(2015,10,30);
            NUtility.Channel c;
            Dictionary<NUtility.Channel,List<NUtility.EPGEvent>> stuff;
            stuff = EPGEvent.GetListingsForTimePeriod(start, end);
            foreach(KeyValuePair<NUtility.Channel,List<NUtility.EPGEvent>> pair in stuff)
            {
                string channel = pair.Key.Name;
                foreach (NUtility.EPGEvent ev in pair.Value)
                {
                    string show = ev.Title;
                    listBox1.Items.Add(string.Format("{0} {1}",channel,show));
                }
            }
        }
    }
}

The development machine is the nextpvr server.

What am I missing here?

Jim
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#2
2015-10-02, 03:21 PM
What version of the .NET framework did you target for your project?
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#3
2015-10-02, 06:25 PM
It's important to mark your application as targeting x86, since the database library we use is a 32bit dll
drmargarit
Offline

Member

Posts: 184
Threads: 49
Joined: Sep 2013
#4
2015-10-02, 11:18 PM
Thanks for the suggestions.

I've lost track of all the times that I've screamed in my head, "This should be working! What is #*!&#@ wrong with windows?!" and I was actually wrong. Not this time. Some visual studio file got locked but never unlocked. Discovered the problem when I decided to erase the whole project from disk and redo it. One file wouldn't delete. Had to kill a rogue vshost32.exe process and delete. Then it worked.

Tip for those who follow: Project-> Properties -> Debug tab -> Working directory. Set it to "C:\Program Files (x86)\NPVR\" to get rid of the sqlitefactory error.

Jim
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#5
2015-10-02, 11:27 PM
You can also include sqlite.interop.dll and system.data.sqlite in your project if you aren't creating a plugin.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't debug with app using Nutility (System.TypeInitializationException) danorum 3 2,890 2015-08-17, 10:53 PM
Last Post: danorum

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode