Announcement

Collapse
No announcement yet.

HS3 Plugin Samples

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by dcorsus View Post
    Have you tried to run it in Studio itself? Does the source code debugger show you where it goes wrong?

    Dirk
    Here is the exception error but I can't say that I become wiser

    System.TypeInitializationException was unhandled
    Message=The type initializer for 'HSPI_SAMPLE.Main' threw an exception.
    Source=HSPI_SAMPLE
    TypeName=HSPI_SAMPLE.Main
    StackTrace:
    at HSPI_SAMPLE.Main.Main()
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(A ctivationContext activationContext, String[] activationCustomData)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssem blyDebugInZone()
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException: System.BadImageFormatException
    Message=Could not load file or assembly 'HomeSeerAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Source=HSPI_SAMPLE
    FileName=HomeSeerAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null
    FusionLog==== Pre-bind state information ===
    LOG: User = ithemmet-Dator\ithemmet
    LOG: DisplayName = HomeSeerAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null
    (Fully-specified)
    LOG: Appbase = file:///C:/utveckling/HSPI_SAMPLE/bin/Debug/
    LOG: Initial PrivatePath = NULL
    Calling assembly : HSPI_SAMPLE, Version=1.0.0.5, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\utveckling\HSPI_SAMPLE\bin\Debug\HSPI_SAMPLE.exe.config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machi ne.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/utveckling/HSPI_SAMPLE/bin/Debug/HomeSeerAPI.DLL.
    ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

    StackTrace:
    at HSPI_SAMPLE.Main..cctor()
    InnerException:
    Please excuse any spelling and grammatical errors I may make.
    --
    Tasker Plugin / Speech Droid
    Tonlof | Sweden

    Comment


      #32
      Originally posted by tonlof View Post
      Here is the exception error but I can't say that I become wiser

      System.TypeInitializationException was unhandled
      Message=The type initializer for 'HSPI_SAMPLE.Main' threw an exception.
      Source=HSPI_SAMPLE
      TypeName=HSPI_SAMPLE.Main
      StackTrace:
      at HSPI_SAMPLE.Main.Main()
      at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
      at System.Runtime.Hosting.ApplicationActivator.CreateInstance(A ctivationContext activationContext, String[] activationCustomData)
      at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssem blyDebugInZone()
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.BadImageFormatException
      Message=Could not load file or assembly 'HomeSeerAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
      Source=HSPI_SAMPLE
      FileName=HomeSeerAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null
      FusionLog==== Pre-bind state information ===
      LOG: User = ithemmet-Dator\ithemmet
      LOG: DisplayName = HomeSeerAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null
      (Fully-specified)
      LOG: Appbase = file:///C:/utveckling/HSPI_SAMPLE/bin/Debug/
      LOG: Initial PrivatePath = NULL
      Calling assembly : HSPI_SAMPLE, Version=1.0.0.5, Culture=neutral, PublicKeyToken=null.
      ===
      LOG: This bind starts in default load context.
      LOG: Using application configuration file: C:\utveckling\HSPI_SAMPLE\bin\Debug\HSPI_SAMPLE.exe.config
      LOG: Using host configuration file:
      LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machi ne.config.
      LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
      LOG: Attempting download of new URL file:///C:/utveckling/HSPI_SAMPLE/bin/Debug/HomeSeerAPI.DLL.
      ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

      StackTrace:
      at HSPI_SAMPLE.Main..cctor()
      InnerException:
      Still concerned about this: C:/utveckling/HSPI_SAMPLE/bin/Debug/HomeSeerAPI.DLL

      why is this not your c:\Program Files (x86)\Homeseer HS3 \HomeSeerAPI.DLL ??

      Did you copy the HomeSeerAPI.DLL to some other directory? Is this file accessible, perhaps corrupt, perhaps old?

      Dirk

      Comment


        #33
        Originally posted by dcorsus View Post
        Still concerned about this: C:/utveckling/HSPI_SAMPLE/bin/Debug/HomeSeerAPI.DLL

        why is this not your c:\Program Files (x86)\Homeseer HS3 \HomeSeerAPI.DLL ??

        Did you copy the HomeSeerAPI.DLL to some other directory? Is this file accessible, perhaps corrupt, perhaps old?

        Dirk
        I have add them directly from Homeseer root folder.
        Attached Files
        Please excuse any spelling and grammatical errors I may make.
        --
        Tasker Plugin / Speech Droid
        Tonlof | Sweden

        Comment


          #34
          Did you try to change it to "x86" instead of "Any CPU" and rebuild it?
          This was my problem and there is good chances this is yours too; it's the first tip given by msdn for the System.BadImageFormatException: http://msdn.microsoft.com/en-us/libr...=vs.90%29.aspx

          Also when you change to x86 and rebuild, it is then written to a different directory so make sure you use the good one.

          Comment


            #35
            Thank you Spud for your ideas.
            I have delete all output folders, change platform to x86 in both debug and release and still have same error. I would be happy if anyone could try the zipfile (HSPI_SAMPLE) so there is no problem with the latest zip.
            Please excuse any spelling and grammatical errors I may make.
            --
            Tasker Plugin / Speech Droid
            Tonlof | Sweden

            Comment


              #36
              Originally posted by tonlof View Post
              Thank you Spud for your ideas.
              I have delete all output folders, change platform to x86 in both debug and release and still have same error. I would be happy if anyone could try the zipfile (HSPI_SAMPLE) so there is no problem with the latest zip.
              HI Tony,


              I to am getting this so you are not alone. I will see what I can do to solve it.

              Greig.
              Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
              X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
              Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
              Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
              Scripts =
              Various

              Comment


                #37
                Originally posted by enigmatheatre View Post
                HI Tony,


                I to am getting this so you are not alone. I will see what I can do to solve it.

                Greig.
                Thank you Greig I have struggled with it whole day.
                Please excuse any spelling and grammatical errors I may make.
                --
                Tasker Plugin / Speech Droid
                Tonlof | Sweden

                Comment


                  #38
                  just tried again with HSPI_SAMPLE, got the same error as you.

                  then I changed platform to x86 from Build/Configuration Manager menu and everything is ok now

                  you have to change it from Build/Configuration Manager, somehow if you change from My PRoject/Compile it doesn't work

                  Comment


                    #39
                    Originally posted by tonlof View Post
                    Thank you Spud for your ideas.
                    I have delete all output folders, change platform to x86 in both debug and release and still have same error. I would be happy if anyone could try the zipfile (HSPI_SAMPLE) so there is no problem with the latest zip.
                    Just downloaded, the zipfile. Only issue was that HSCF reference was not OK. After setting that, compiled error free, runs remote under debugger, no problem.

                    Which version of Compiler are you using? Which OS version? I'm using Win7 & Studio 2010. I DO NOT copy any of the reference DLLs, I point the reference to the files in the HS3 directory AND compile into the HS3 directory. I'm on HS3 version .38

                    If I change the CPU type like Spud is indicating than I have the same problem.


                    Dirk

                    Comment


                      #40
                      Originally posted by dcorsus View Post
                      I'm using Win7 & Studio 2010
                      win7 32-bit or 64-bit?

                      here I' using win7 64-bit & Studio 2010

                      Comment


                        #41
                        Originally posted by spud View Post
                        j

                        you have to change it from Build/Configuration Manager, somehow if you change from My PRoject/Compile it doesn't work
                        Yep thats it.

                        Well done spud. Thanks.

                        Greig
                        Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
                        X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
                        Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
                        Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
                        Scripts =
                        Various

                        Comment


                          #42
                          Originally posted by spud View Post
                          win7 32-bit or 64-bit?
                          64 bit

                          Comment


                            #43
                            Originally posted by spud View Post
                            you have to change it from Build/Configuration Manager,
                            The problem was that Build menu was missing and I follow some guide to activate it but it fails. Then I install VB 2010 Express on another windows 7 English and the Build menu works fine to unhide.

                            Then I export all settings and import it to the "problem computer" but it did not appear anyway soo I think I have a bad installation of VB2010 or may be some problem with non English windows version.

                            So everything is now working with my English windows 7

                            I'm sorry that the thread got so long, maybe I should have created a separate thread. Admin feel free to move it if possible.
                            At the same time, I would like to thank everyone for a persistent help.
                            Please excuse any spelling and grammatical errors I may make.
                            --
                            Tasker Plugin / Speech Droid
                            Tonlof | Sweden

                            Comment


                              #44
                              I don't want to appear as an ungrateful individual but is there any chance we could have a nice simple plugin template to get started with?

                              The samples are good with some good features but it is a bit all over the place and IMHO a bit complex for a simple plugin. I have been trying to pull apart the sample and got some of it working but the triggers/actions are not that well commented and there are quite a few functions that are uncommented and I end up looking all over the place for an explanation of what they do. Unfortunately some of the functions in the help file are not explained either so it ends up being guesswork.

                              Comment


                                #45
                                There are 3 samples provided, did you look at the samplebasic one? That one is suppose to be just the basics.

                                Originally posted by mrhappy View Post
                                I don't want to appear as an ungrateful individual but is there any chance we could have a nice simple plugin template to get started with?

                                The samples are good with some good features but it is a bit all over the place and IMHO a bit complex for a simple plugin. I have been trying to pull apart the sample and got some of it working but the triggers/actions are not that well commented and there are quite a few functions that are uncommented and I end up looking all over the place for an explanation of what they do. Unfortunately some of the functions in the help file are not explained either so it ends up being guesswork.
                                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                                Comment

                                Working...
                                X