Visual Studio Code C# - Error MSB4062



  • 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!



  • @DGutierrez3

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



  • @DGutierrez3

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



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



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



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



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

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

    Your definitely correct.


Log in to reply