NotepadPlusPlusPluginPack.Net
NotepadPlusPlusPluginPack.Net copied to clipboard
Building new project from template, error "task could not be loaded from the assembly .. NppPlugin.DllExport.MSBuild.dll"
Recently I got a clean Windows 10 installation and I reinstalled Visual Studio. I downloaded the latest version of the template. I put the NppPlugin0.95.00.zip file in the template directory, and create a new project. However then I get this error when I build the project created from the template.
1>Done building target "CoreBuild" in project "MyNppPlugin1.csproj".: (TargetId:78)
1>Target "GetFrameworkPaths" skipped. Previously built successfully.
1>Target "AfterBuild: (TargetId:79)" in file "C:\Users\BdR\source\repos\MyNppPlugin1\MyNppPlugin1\PluginInfrastructure\DllExport\NppPlugin.DllExport.targets" from project "C:\Users\BdR\source\repos\MyNppPlugin1\MyNppPlugin1\MyNppPlugin1.csproj" (target "Build" depends on it):
1>C:\Users\BdR\source\repos\MyNppPlugin1\MyNppPlugin1\PluginInfrastructure\DllExport\NppPlugin.DllExport.targets(13,5): error MSB4062: The "NppPlugin.DllExport.MSBuild.DllExportTask" task could not be loaded from the assembly C:\Users\BdR\source\repos\MyNppPlugin1\MyNppPlugin1\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. Het systeem kan het opgegeven bestand niet vinden. Confirm that the <UsingTask> 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>Done building target "AfterBuild" in project "MyNppPlugin1.csproj" -- FAILED.: (TargetId:79)
I've also checked this issue but there's only a mention that the latest template should work.
Do I have to install .NET 3.5? (seems unlikely because that's an older verion, plus the other issue mentions that should not be necessary) Is it correct that the NppPlugin.DllExport.MSBuild.dll file is from may 2016 (see here)? Or do I have to manually rebuild the NppPlugin.DllExport.MSBuild.dll, and if so how?
I just installed the .NET 3.5 dev tool and it works again. So for anyone else reading, you can:
- start Visual Studio Installer (separate app)
- click Visual Studio "Modify" button
- select "Individual components" tab
- check ".NET framework 3.5 development tools" and press "Modify" to install.
Then back to the Visual Studio plugin project, rebuild and this particular error is resolved.
But just so I understand correctly, the DLL files in this update weren't recompiled, but rather the ones here were replaced with these 'newer' ones. So, these DLL files are the same (I did a filecompare) and they still do require .NET 3.5. The .NET 3.5 component isn't installed by default anymore, so I think it should also be mentioned in the "Getting started" part of the readme file that you need to install it.
Hello, is the latest version of the template working correctly?
Hello, is the latest version of the template working correctly?
Yes the latest version of the template works correctly, but you do have to install the .NET 3.5 dev tool