You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Repository navigation
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
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?
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
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.
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
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.
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.
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
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)
Also had to set Build->Platform target: x64 (since I was using Notepad++ x64 release]
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.
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.
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.
@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.
Activity
LesF commentedon Aug 7, 2020
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
mahee96 commentedon Aug 9, 2020
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.
LesF commentedon Aug 10, 2020
I get the same error using the PluginInfrastructure folder from the source. Do I need to install .Net 3.5 to use this?
mahee96 commentedon Aug 11, 2020
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
LesF commentedon Aug 11, 2020
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.
[-]VS2019 requirements for building[/-][+]VS2019 requirements - still dependant on .Net 3.5[/+]mahee96 commentedon Aug 12, 2020
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.
mahee96 commentedon Aug 12, 2020
@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.
mahee96 commentedon Aug 12, 2020
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
@LesF I tested all these with VS2019 and it works perfectly.
mahee96 commentedon Aug 12, 2020
@kbilsted @LesF PR #57 should update the demo plugin (ready for VS2019).
kbilsted commentedon Aug 12, 2020
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.
mahee96 commentedon Aug 12, 2020
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.
kbilsted commentedon Aug 12, 2020
@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.
LesF commentedon Aug 12, 2020
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.
LesF commentedon Aug 13, 2020
Have created my first github project, and my plugin works, https://github.com/LesF/NppPlugin-ZipFileList
kbilsted commentedon Aug 13, 2020
@LesF glad to hear.if you like our project please link to us from your project to help spread the word
Merge pull request #57 from mahee96/master