Announcement

Collapse
No announcement yet.

HS-634 - mono-vbnc deprecated

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

    HS-634 - mono-vbnc deprecated

    HS4 is still using the mono-vbnc package for the VB compiler. vbnc is deprecated in favor of vbc.

    From https://github.com/mono/mono-basic/c...32471c5227a545

    Code:
    >>>> vbnc is deprecated and will be removed in future updates, use vbc instead <<<<
    I've had issues with compiling some data structures that work fine on the Windows platform. I posted an issue on mono github, and it was suggested to try vbc instead. Under vbc, the structures compile correctly.

    vbc is a Microsoft product, per the copyright notice displayed upon invocation. It is provided in package mono-roslyn, which is a dependency of mono-devel and/or mono-complete:

    Code:
    pi@hs4beta:~/vb $ dpkg -S /usr/bin/vbc
    mono-roslyn: /usr/bin/vbc
    pi@hs4beta:~/vb $ apt-cache rdepends mono-roslyn
    mono-roslyn
    Reverse Depends:
      mono-complete
      mono-devel
    so it is installed as part of mono-devel or mono-complete.

    #2
    rjh macromark

    Comment


      #3
      seems like copy pasting the content of /usr/bin/vbc :

      Code:
      exec /usr/bin/mono --gc-params=nursery-size=64m $MONO_OPTIONS /usr/lib/mono/4.5/vbc.exe "$@"
      into /usr/bin/vbnc resolve the aspx issue....

      So just calling vbc (HST) instead of vbnc would resolve the compiling issue saw on hs3.

      The aspx page are loading quite faster now ! WOW

      bsobel



      I can even open /BLLock_activity.aspx now :O
      Attached Files

      Comment


        #4
        but on hs4 there is another issue : https://forums.homeseer.com/forum/de...ersion-3-0-0-1

        the dll are windows formatted.

        Comment


          #5
          I am annoyed with its compatibility problem! you really don't know how to use one solution to all of you agree to compile? or is it going to be wrong that I switch to windows and abandon linux which is however much more stable?
          give us a mono version where all the programs work and if there is a fix tell us! I think its a homeseer to give the solution so that everything runs smoothly and to give the standard!

          Comment


            #6
            HS4 is not calling vbnc so I am not sure where that is being called. We execute ASPX pages using the MS API's. I even searched all our code and files for "vbnc" and could not find it. So maybe this is an installation issue? What happens if you just uninstall vbnc and leave vbc installed? Must be setting in MONO somewhere that is picking the compiler.
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              I thought vbnc was called to compile scripts or one-line script commands. Maybe I am mis-remembering?
              HS4Pro on a Raspberry Pi4
              54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
              Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

              HSTouch Clients: 1 Android

              Comment


                #8
                I just use the scripting API I do not call VBNC directly so MONO is handling this.

                Originally posted by rmasonjr View Post
                I thought vbnc was called to compile scripts or one-line script . Maybe I am mis-remembering?
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment


                  #9
                  When you search for mono-vbc you get this comprehensive document : https://www.mono-project.com/docs/ab...s/visualbasic/


                  Eman.
                  TinkerLand : Life's Choices,"No One Size Fits All"

                  Comment


                    #10
                    rjh Does test.aspx work on your test HS4 system running on Linux?

                    Comment


                      #11
                      Originally posted by rjh View Post
                      HS4 is not calling vbnc so I am not sure where that is being called. We execute ASPX pages using the MS API's. I even searched all our code and files for "vbnc" and could not find it. So maybe this is an installation issue? What happens if you just uninstall vbnc and leave vbc installed? Must be setting in MONO somewhere that is picking the compiler.
                      Yes it is. vbnc is used to compile all .vb scripts (for instance Startup.vb), immediate script, or aspx file with language=vb in the page directive.

                      With package mono-vbnc not installed (apt-get purge mono-vbnc), errors appear in log for each .vb script execution attempt
                      Code:
                       [COLOR=#FF0000]2/17/2020 7:51:06 AM HomeSeer Error Compiling script Startup.vb: Error running vbnc: Cannot find the specified file [/COLOR]

                      Comment


                        #12
                        Originally posted by Eman View Post
                        When you search for mono-vbc you get this comprehensive document : https://www.mono-project.com/docs/ab...s/visualbasic/
                        If you'd bothered to read that you'd have discovered it's woefully out of date

                        ... The current Mono 2.6 release ...

                        Comment


                          #13
                          I am not arguing that vbnc is getting called, it obviously is. I am saying that I am not specifying the compiler, someone else is. I do appreciate the help here and if someone can figure out how to specify the compiler I will gladly make the the change.

                          We are doing this to set up the scripting:

                          oCodeProvider = New VBCodeProvider

                          We then add a bunch of assemblies:

                          Code:
                          oCParams.ReferencedAssemblies.Add("System.dll")
                                          oCParams.ReferencedAssemblies.Add("System.Core.dll")
                                          oCParams.ReferencedAssemblies.Add("System.Xml.dll")
                                          oCParams.ReferencedAssemblies.Add("System.Data.dll")
                                          oCParams.ReferencedAssemblies.Add("Scheduler.dll")
                                          oCParams.ReferencedAssemblies.Add("HomeSeerAPI.dll")
                                          oCParams.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll")
                                          oCParams.ReferencedAssemblies.Add("System.Data.DataSetExtensions.dll")
                                          oCParams.ReferencedAssemblies.Add("System.Data.Linq.dll")
                                          oCParams.ReferencedAssemblies.Add("System.Xml.Linq.dll")
                                          oCParams.ReferencedAssemblies.Add("HSCF.dll")
                          Then make a call to compile it:

                          Code:
                          oCResults = oCodeProvider.CompileAssemblyFromSource(oCParams, stb.ToString)
                          I will have to see how MONO handles the VBCodeProvider class as this is in the Microsoft.Visualbasic dll file.

                          ASPX is handled totally differently, but whatever change would specify the compiler will probably fix that also.

                          Originally posted by zwolfpack View Post

                          Yes it is. vbnc is used to compile all .vb scripts (for instance Startup.vb), immediate script, or aspx file with language=vb in the page directive.

                          With package mono-vbnc not installed (apt-get purge mono-vbnc), errors appear in log for each .vb script execution attempt
                          Code:
                           [COLOR=#FF0000]2/17/2020 7:51:06 AM HomeSeer Error Compiling script Startup.vb: Error running vbnc: Cannot find the specified file [/COLOR]
                          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                          Comment


                            #14
                            I did find this with some Googling, so I will experiment with this tag and see if this works:

                            For some reason, Mono uses vbnc by default although there is a Roslyn-based VB compiler built-in to Mono, vbc. Interestingly, vbnc is even not being installed with mono-devel package and it still being used by default.

                            If you installed vbnc and started to get this message:
                            "error MSB6006: "vbnc.exe" exited with code 1"
                            you need to instruct Mono to use vbc instead and your code will build. The most reliable way to do it is to set it per project, by adding the following XML to your vbproj file:
                            <PropertyGroup> <VbcToolExe>vbc</VbcToolExe> </PropertyGroup>
                            The code should be placed inside the root <Project> tag.
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #15
                              Nice find, hope this pans out!

                              Comment

                              Working...
                              X