Announcement

Collapse
No announcement yet.

Help with Newtonsoft.Json error

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Newtonsoft.Json error

    Thanks for doing this, it saves me a lot of time trying to figure out the scripting. Unfortunately, I cannot get the plugin to function properly. Any idea why I'm getting this error?

    Thanks
    Mar-11 10:12:16 Plug-In Finished initializing plug-in TankUtility
    Mar-11 10:12:16 Starting Plug-In TankUtility loaded in 2295 milliseconds
    Mar-11 10:12:16 Error Initializing plug-in(2): TankUtility Instance::Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.STACK: Server stack trace: Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessag e(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(Mess ageData& msgData, Int32 type) at HomeSeerAPI.IPlugInAPI.InitIO(String port) at Scheduler.clsHSPI.CheckInterfaces()
    Mar-11 10:12:14 Starting Plug-In Initializing plugin TankUtility ...
    Mar-11 10:12:14 Info Plugin TankUtility has connected. IP:127.0.0.1:52394

  • #2
    What version of HS and OS are you running on? The plug-in comes with its own version of the Newtonsoft.Json DLL (stored in its own private folder at install time). It should be under the HS3 main directory in bin/TankUtil. Please check to make sure it is there. Also, do you happen to have a copy of Newtonsoft.Json.DLL in your main HS3 directory? That might create an issue.

    Comment


    • #3
      I am using HS 3.0.0.478 on Windows 10 Pro. The Newtonsoft.Json DLL is in fact in the bin/TankUtil directory. I have removed the copy of Newtonsoft.Json from the /bin directory. Still same error.

      Comment


      • #4
        Actually, noticed the directory is Bin not bin. Tried changing the name no help.

        Comment


        • #5
          On Windows I don't think the case of the directory names or file names matters where it does on Linux. So there isn't a copy of the JSON DLL in the root of HS3 (not just under bin)? I think the one under Bin would have been fine but my understanding of how the DLLs get discovered/used by HS indicates there can't be one in the root of the HS3 directory structure.

          If that isn't the issue, I will try doing a fresh install of it on my Windows HS3 and see if I can replicate it this evening.

          Comment


          • #6
            There is no copy in the HS3 root directory. I had issues getting a script to run for TankUtility in the past and tried to work around it by adding a scripting reference in the settings.ini. I removed the scripting reference line from the ini file with no help. Perhaps I need to put in something else in the scripting reference line of the ini file. Let me know how a fresh install works out.

            Comment


            • #7
              Thanks for the extra info.

              There is no dependence on the scripting or the ScriptingReference in the settings.ini file for the plug-in. Certainly if you are using JSON in a script to interact with TU.com, it would be in play but the plug-in doesn't use any scripting but rather direct .NET code calls to the service.

              I will give it a try on my Windows system tonight. I know I tested it on there before releasing it but the JSON thing is a bit finicky.

              Did you happen to try removing the plug-in and re-installing it from the updater? Shouldn't be necessary but sometimes brute force is the answer.

              Comment


              • #8
                Just tried that and still no go.

                Comment


                • #9
                  I am having a very similar issue running on a new Windows 10 Pro machine with PHLocation2 (It all worked correctly on my Windows 7). I am subscribing to this thread but will also post here if I manage to stumble across a resolution.

                  Comment


                  • #10
                    Originally posted by FastFreddi View Post
                    I am using HS 3.0.0.478 on Windows 10 Pro. The Newtonsoft.Json DLL is in fact in the bin/TankUtil directory. I have removed the copy of Newtonsoft.Json from the /bin directory. Still same error.
                    Did you restart after doing this? Caching in .net/mono may cause it to still load from there if its already in memory causing a phantom issue until reboot.

                    Comment


                    • #11
                      Reboot had no effect

                      Comment


                      • #12
                        Originally posted by FastFreddi View Post
                        Reboot had no effect
                        Hmmmm, I cleared my Windows HS3 machine (deleted the plug-in EXE, deleted the bin/TankUtil folder and files, deleted the TankUtil.ini files in Config, …. I restarted HS3 and then took the download from Updater. After putting my TU account info in, I got the devices and all the data with no warnings about not being able to load the JSON DLL. This is running HS3 3.0.0.500 (note I tried it on the 4xx builds before releasing it so I don't think v500 has anything to do with it) and Win10 Pro (build 10.0.17134) so the config should be very similar to yours.

                        Do you know what version of .NET runtime is installed on the system? Do you have other plug-ins that have a version of the JSON DLL installed in a private directory as well? (trying to figure out if it is something to do with how the TU plug-in got installed or if it is any PI using the Newtonsoft DLL).

                        Comment


                        • #13
                          I have .NET framework version 4.7 installed. I've disabled all plugins that have a private JSON DLL with the exception of z-wave and I've updated to HS3 3.0.0.500 then reboot and still get this error.

                          Comment


                          • #14
                            Following up: I know it was a different Plug-In, but I was able to fix my problem by removing and reinstalling the Plug-In. I was pretty thorough in making sure all the files associated with the plug-in were removed and all the devices it created were gone before reinstalling. The only thing I did differently is use Chrome to download the install file instead of Microsoft Edge. I know it shouldn't make a difference but..

                            Hope this helps

                            Comment


                            • #15
                              Originally posted by FastFreddi View Post
                              I have .NET framework version 4.7 installed. I've disabled all plugins that have a private JSON DLL with the exception of z-wave and I've updated to HS3 3.0.0.500 then reboot and still get this error.
                              Strange. Everything sounds like it is correct. I tried the clean install 3 more times last night and every time it came up without a problem. Not sure what the issue is at this point. I wasn't looking for you to disable the other PI's that use the JSON DLL but rather verify that they were all working correctly for you even though mine wasn't. That would help eliminate things going on in the overall system as a cause.

                              Do you have the file HSPI_TankUtil.exe.config in your HS3 root directory after the install? That has the reference in it ( <probing privatePath="bin/TankUtil" />) for where to search for the JSON DLL for the TU plugin. If that isn't there for whatever reason, that would certainly be an issue. After I do an install, it is left in the root of the HS3 install directory.

                              Comment

                              Working...
                              X