如何将现有的小部件添加到 Nopcommerce?

How to add an existing widget to Nopcommerce?

我对Nopcommerce 真的很陌生。我有一个现有的插件 [主页的滑块小部件]。我试图在 Visual Studio 17 的插件目录中添加 Nop.Plugin.Widget.PromoSlider.csproj 文件,但出现以下错误:

The imported project "S(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" was not found. Also, tried to find "S(VSToolsPath)\WebApplications\Mlicrosoft.WebApplication.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v15.0" These search paths are defined in "C:\Users***\AppData\Local\ Microsoft\VisualStudio.0_f96fcd52\devenv.exe.config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. C:\Users****\Deskctop\ Nop.Plugin.Widget.PromoSlider\Nop.Plugin.Widget.PromoSlider.csproj

谁能帮我解决这个错误?

我猜你正试图在 visual studio 2017 中添加一个 visual studio 2015 项目。正在对此问题进行调查。但是也有一个解决方法。请检查 here 了解更多详情。

一种解决方法是更改​​以下行(编辑 Nop.Plugin.Widget.PromoSlider.csproj

<Import Project="$(VSToolsPath)\Web\Microsoft.Web.Publishing.targets" Condition="'$(VSToolsPath)' != ''" />

<Import Project="/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild/Microsoft/VisualStudio/v14.0/WebApplications/Microsoft.WebApplication.targets" />

试一试