Plugin example doesnt show in list (1 Viewer)

A

Anonymous

Guest
Hi,

Ive been programming for some time now in C# and wanted to try and build a plugin for mediaportal (which ive been using for a bit longer).

I found the tutorial at http://mediaportal.sourceforge.net/PluginTutorial/PluginTutorial.htm which compiled fine, but it doesnt show up at the plugin list :\
Edit: The log says: Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.

Ive searched the forum for a solution, but havent been lucky yet. Can anyone help me out?

Ive attached the code Ive compiled using Visual C# 2005 Express.

Code:
using System;
using System.Windows.Forms;
using MediaPortal.GUI.Library;

namespace SomePlugin
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class PluginClass : GUIWindow, ISetupForm
    {
        public PluginClass()
        {
           //
           // TODO: Add constructor logic here
           //
        }
        #region ISetupForm Members
 
        // Returns the name of the plugin which is shown in the plugin menu
        public string PluginName()
        {
           return "PluginClass";
        }
 
         // Returns the description of the plugin is shown in the plugin menu
        public string Description()
        {
           return "Does stuff.";
        }
 
        // Returns the author of the plugin which is shown in the plugin menu
        public string Author()     
        {
           return "me";
        }  
       
        // show the setup dialog
        public void   ShowPlugin() 
        {
           MessageBox.Show("Nothing to configure yet!");
        }  
 
        // Indicates whether plugin can be enabled/disabled
        public bool   CanEnable()  
        {
           return true;
        }  
 
        // get ID of windowplugin belonging to this setup
        public int    GetWindowId()
        {
           return 5678;
        }  
       
         // Indicates if plugin is enabled by default;
        public bool   DefaultEnabled()
        {
           return true;
        }  
       
 
 
       // indicates if a plugin has its own setup screen
        public bool   HasSetup()   
        {
           return true;
        }   
   
        /// <summary>
        /// If the plugin should have its own button on the main menu of Media Portal then it
        /// should return true to this method, otherwise if it should not be on home
        /// it should return false
        /// </summary>
        /// <param name="strButtonText">text the button should have</param>
        /// <param name="strButtonImage">image for the button, or empty for default</param>
        /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
        /// <param name="strPictureImage">subpicture for the button or empty for none</param>
        /// <returns>true  : plugin needs its own button on home
        ///          false : plugin does not need its own button on home</returns>
        public bool   GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
        {
           strButtonText=String.Empty;
           strButtonImage=String.Empty;
           strButtonImageFocus=String.Empty;
           strPictureImage=String.Empty;
           return false;
        }
    #endregion
    }
}
 

hagur

Portal Member
September 4, 2004
21
1
The code looks fine to me .... now this may sound like a stupid question, but did you copy your plugin .dll file to the plugin-folder in your MP-directory?
 
A

Anonymous

Guest
Like the tutorial said, I moved the DLL to the plugins/windows folder. Ive also tried the process folder, but made no difference.

Edit: The log says: Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
The answer is simple, but its not good news:

MP works off the .NET framework 1.1, used with VS.NET 2003. C# Express 2005 (or any of the .NET IDEs with 2005 in it) compile against .NET Framework 2.0, which does not work with .NET framework 1.1. BTW, .NET Framework 2.0 is still in beta, so MP will not support it until later.

Sam
 
A

Anonymous

Guest
Thanks for your reply! Guess i'll have to wait then for MP to be in .NET2 :}
 

Users who are viewing this thread

Top Bottom