• Login
Community
  • Login

Visual Studio Code C# - Error MSB4062

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
8 Posts 5 Posters 1.1k 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.
  • D
    DGutierrez3
    last edited by Apr 14, 2020, 8:31 PM

    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!

    E A 3 Replies Last reply Apr 14, 2020, 10:02 PM Reply Quote 0
    • E
      Ekopalypse @DGutierrez3
      last edited by Apr 14, 2020, 10:02 PM

      @DGutierrez3

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

      D 1 Reply Last reply Apr 15, 2020, 12:18 AM Reply Quote 2
      • A
        Alan Kilborn @DGutierrez3
        last edited by Apr 14, 2020, 10:14 PM

        @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
        • D
          dail @Ekopalypse
          last edited by Apr 15, 2020, 12:18 AM

          @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
          • E
            Ekopalypse @DGutierrez3
            last edited by Apr 15, 2020, 11:35 AM

            @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.

            A 1 Reply Last reply Apr 15, 2020, 11:56 AM Reply Quote 1
            • A
              Alan Kilborn @Ekopalypse
              last edited by Apr 15, 2020, 11:56 AM

              @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.

              E 1 Reply Last reply Apr 15, 2020, 11:58 AM Reply Quote 2
              • E
                Ekopalypse @Alan Kilborn
                last edited by Apr 15, 2020, 11:58 AM

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

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

                Your definitely correct.

                S 1 Reply Last reply Feb 8, 2024, 7:45 AM Reply Quote 2
                • S
                  Skycc Lim @Ekopalypse
                  last edited by Feb 8, 2024, 7:45 AM

                  @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