Community
    • Login

    Visual Studio Code C# - Error MSB4062

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    8 Posts 5 Posters 934 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DGutierrez3D
      DGutierrez3
      last edited by

      Hello everyone, some time ago I am trying to develop a plugin for Notepad++. But unfortunately without much success.
      Before giving up I would like to share my problem with you. Maybe they can give me a hand.

      My goal is to develop it with Visual Studio Code in C#. As a basis for may project I have downloaded the following Pack NotepadPlusPlusPluginPack.Net (I don´t know if there is a more updated version).

      However, when I complie the project I get the following error :
      09b2ab42-ebcb-4a07-8655-1ae18936e765-image.png

      How can i solve this error?

      Iteresting is that the *.dll Library is generated. However this is not compatible with Notepad++

      a002edb3-e345-4b17-bfa9-7d3866739d23-image.png

      The same question (with some extra details) I have posted in Stackoverflow.

      I would be happy receive any questions, suggestions or comments.
      Many thanks!

      EkopalypseE Alan KilbornA 3 Replies Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @DGutierrez3
        last edited by

        @DGutierrez3

        If you get back that this is an ANSI version then the call to IsUnicode does not return True.

        dailD 1 Reply Last reply Reply Quote 2
        • Alan KilbornA
          Alan Kilborn @DGutierrez3
          last edited by

          @DGutierrez3

          And since your plugin contains that function, you should be easily able to set it to return true!

          1 Reply Last reply Reply Quote 3
          • dailD
            dail @Ekopalypse
            last edited by

            @Ekopalypse And just an FYI this error message from Notepad++ is a little too general. It usually isnt specific just for that function (though it is possible I guess), but at least it does indicate something is wrong with the DLL such as not having the correct symbols exported.

            1 Reply Last reply Reply Quote 4
            • EkopalypseE
              Ekopalypse @DGutierrez3
              last edited by

              @dail - thank you.

              @DGutierrez3
              to make sure that the functions are exported you can use
              a visual studio command prompt and call dumpbin /exports YOUR_PLUGIN.dll

              something like

              dumpbin /exports PySnack.dll
              
              Microsoft (R) COFF/PE Dumper Version 14.16.27038.0
              Copyright (C) Microsoft Corporation.  All rights reserved.
              
              
              Dump of file PySnack.dll
              
              File Type: DLL
              
                Section contains the following exports for Npp.cp37-win_amd64.pyd
              
                  00000000 characteristics
                  FFFFFFFF time date stamp
                      0.00 version
                         1 ordinal base
                         7 number of functions
                         7 number of names
              
                  ordinal hint RVA      name
              
                        1    0 00367360 PyInit_Npp
                        2    1 003A4760 beNotified
                        3    2 003A8F50 getFuncsArray
                        4    3 003A7970 getName
                        5    4 003A4660 isUnicode
                        6    5 003A46E0 messageProc
                        7    6 003A79F0 setInfo
              
                Summary
              
                     5F000 .data
                      D000 .pdata
                     64000 .rdata
                      3000 .reloc
                      1000 .rsrc
                    4C2000 .text
              

              Forget about the PyInit_Npp, this is specific to my plugin but
              the other 6 must be there.

              Alan KilbornA 1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn @Ekopalypse
                last edited by

                @Ekopalypse

                That might have been better as a “black” code box, as I was about to ask where to see PyInit_Npp

                Only almost just before posting did I notice the scroll bar on the far right. :-)

                Good info, though; I guess we all learned something.

                EkopalypseE 1 Reply Last reply Reply Quote 2
                • EkopalypseE
                  Ekopalypse @Alan Kilborn
                  last edited by

                  @Alan-Kilborn said in Visual Studio Code C# - Error MSB4062:

                  That might have been better as a “black” code box,

                  Your definitely correct.

                  Skycc LimS 1 Reply Last reply Reply Quote 2
                  • Skycc LimS
                    Skycc Lim @Ekopalypse
                    last edited by

                    @DGutierrez3
                    i face the exact same issue you mention on top when i migrate my development environment to new PC with fresh intallation of visual studio. 1st i thought would be due to newer version of visual studio but its not.

                    later on i found the solution for this, not sure if you still need it, keep a record here in case anyone else face the same issue.

                    Solution:
                    this was due to missing .net framework 3.5, just need to manually install .net framework 3.5 solve my compilation issue. Guess .net 3.5 only come with VS 2015 or older, VS 2017 onwards come with newer .net framework

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors