Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

VS2019 requirements - still dependant on .Net 3.5 #55

Closed

Description

@LesF

With a new project created using NppPlugin0.94.00.zip, using VS2019, the build failed with "Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0". I had installed the workload "Desktop development with C++", but this does not provide the required build tools or expected version.

Has anybody created a guide for getting this to build in VS2019?

Activity

  1. LesF commented on Aug 7, 2020

    @LesF
    Author

    Full error:
    The "NppPlugin.DllExport.MSBuild.DllExportTask" task could not be loaded from the assembly C:\Projects\Misc\NppPlugins\ZipFileList\ZipFileList\PluginInfrastructure\DllExport\NppPlugin.DllExport.MSBuild.dll. Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. ZipFileList

  2. mahee96 commented on Aug 9, 2020

    @mahee96
    Collaborator

    I am already using VS2019 for my builds and it completely works fine, There have been changes to the code, to fix some bugs after the last release NppPlugin0.94.00.zip, So I think if you re-build it from source you wont have any issues.
    [The issue was the DLLExport script which was referring to some old lib.exe or something]

    Just download the source, copy and replace the PluginInfrastructure folder from the downloaded source.zip into your plugin project and try again.

  3. LesF commented on Aug 10, 2020

    @LesF
    Author

    I get the same error using the PluginInfrastructure folder from the source. Do I need to install .Net 3.5 to use this?

  4. mahee96 commented on Aug 11, 2020

    @mahee96
    Collaborator

    Let's try the verbose build log first to see exactly what's causing the issue, as .NET v4.0 is a minimum requirement for this implementation and you should have it to start working with this project.

    Try to set the build log and console ouput to be detailed, attach the log as a text file here

    https://www.teamdevelopmentforsitecore.com/Blog/increase-build-log-verbosity-details-build-problem

  5. LesF commented on Aug 11, 2020

    @LesF
    Author

    When I open the solution it prompts to say that it is targeting .Net 3.5, which is not installed, and prompts to upgrade NppManagedPluginDemo.VS2015 to .Net 4.6.1 or download 3.5. I chose the upgrade option, but it looks like references to build versions are not upgraded when it does this.

    Building the cloned repo gives:

    1>C:\Projects\Misc\NppPlugins\NotepadPlusPlusPluginPack.Net\Demo Plugin\NppManagedPluginDemo\PluginInfrastructure\DllExport\NppPlugin.DllExport.targets(8,5): error MSB4062: The "NppPlugin.DllExport.MSBuild.DllExportTask" task could not be loaded from the assembly C:\Projects\Misc\NppPlugins\NotepadPlusPlusPluginPack.Net\Demo Plugin\NppManagedPluginDemo\PluginInfrastructure\DllExport\NppPlugin.DllExport.MSBuild.dll. Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
    1>

    Note: I got access to a machine with .Net 3.5 installed, cloned and built the solution with no error. Circumstances make it difficult to get 3.5 installed on my machine right now.

  6. changed the title [-]VS2019 requirements for building[/-] [+]VS2019 requirements - still dependant on .Net 3.5[/+] on Aug 11, 2020
  7. mahee96 commented on Aug 12, 2020

    @mahee96
    Collaborator

    Ah, so it was the demo plugin then, sorry I didn't look into the demo plugin much and I thought you were referring to the template itself.

    Try to manually zip the files from "Visual Studio Project Template C#" downloaded source.zip and place them in the "Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C#" and create a new project from the newly added template. The template in itself features a demo plugin and can be built to run directly. (This should use .Net v4.0 by default)

    Let us know if the issue of old references to .Net 3.5 is still persistent with this method.

  8. mahee96 commented on Aug 12, 2020

    @mahee96
    Collaborator

    @LesF I tried the Demo Plugin NppManagedPluginDemo.VS2015.sln and can confirm it is obsolete also not working.

    As I mentioned in my previous comment, create a plugin from the template and it should have all the latest commits/updates and should work out of box.

    we will look what we can do with the demo plugin.

  9. mahee96 commented on Aug 12, 2020

    @mahee96
    Collaborator

    Wow, I didn't care to use this demo plugin till now and was surprised to see it has some cool features implemented.

    For me the issue was the old reference to DLL export targets (which were not being updated in parallel with the main plugin template) [Since they were compiled assemblies all I had to do was to copy DLLExport folder from the "\Visual Studio Project Template C#\PluginInfrastructure" into "\NppManagedPluginDemo\PluginInfrastructure" and overwrite those obsolete DLL export target assemblies].

    Additional changes to get the Demo Plugin running

    1. In the Project Properties page, set the .NET framework to 4.0 or anything above (Note: 3.5 works for me too but it is not recommended)
    2. Also had to set Build->Platform target: x64 (since I was using Notepad++ x64 release]
    3. Run the Build process and copy over the built dll into notepad++ plugin directory and inside its own folder.

    @LesF I tested all these with VS2019 and it works perfectly.

  10. mahee96 commented on Aug 12, 2020

    @mahee96
    Collaborator

    @kbilsted @LesF PR #57 should update the demo plugin (ready for VS2019).

  11. kbilsted commented on Aug 12, 2020

    @kbilsted
    Owner

    Let's figure out what to do with the project as a whole. Perhaps we should merge it with the projekt template and change that to project that can be mutated to serve new projects.

    The demo is really nice in that it serves as an integration test.

  12. mahee96 commented on Aug 12, 2020

    @mahee96
    Collaborator

    yes true, I too thought that the manual copy pasting(DLL export files) won't be at the top of our heads when we do some changes in the template's PluginInfrastructure folder. Better we can have it linked somehow to keep them in sync whenever there is some change.

  13. kbilsted commented on Aug 12, 2020

    @kbilsted
    Owner

    @mahee96 Preferably all the code-generated files were placed in a dll used via nuget.

    but it may make it difficult to debug / understand what is going on - also im not sure the dll export can include extra dll's.

    But the current thing is not nice either with a demo/test project and a vs project that cannot be executed directly but only tested via copying the projtemplate and generating a new project.

    The demo project should have a simple assert functionality so you can eg. modify the text buffer and request all the text and assert the content is as expected eg.

  14. LesF commented on Aug 12, 2020

    @LesF
    Author

    Thanks, I have a running project now. Was able to attach to Notepad++ and debug too. The demo is a good reference so it's worth having it there.

  15. LesF commented on Aug 13, 2020

    @LesF
    Author

    Have created my first github project, and my plugin works, https://github.com/LesF/NppPlugin-ZipFileList

  16. kbilsted commented on Aug 13, 2020

    @kbilsted
    Owner

    @LesF glad to hear.if you like our project please link to us from your project to help spread the word

  17. added a commit that references this issue on Aug 14, 2020
    9e85373
  18. self-assigned this
    on Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions