我在 Windows 10 下的 Visual Studio 2015 社区版之上安装了WebSharper 扩展,然后继续试用 UI.Next 单页应用程序项目模板。
使用 F5 构建它会导致以下结果,而我期望它“正常工作”。解决此类错误的最佳方法是什么?(我对 Windows 编程很陌生)。
\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\build\WebSharper.targets(57,5): error MSB4036: The "WebSharperTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin" directory.
完整的构建日志:
------ Build started: Project: UINextApplication1, Configuration: Debug Any CPU ------
C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\fsc.exe -o:obj\Debug\UINextApplication1.dll -g --debug:full --noframework --define:DEBUG --define:TRACE --optimize- --tailcalls- -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\IntelliFactory.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.Linq.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Collections.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Control.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Core.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Core.JavaScript.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Html.Client.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Html.Server.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.InterfaceGenerator.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.JavaScript.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.JQuery.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Main.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Sitelets.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Testing.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.UI.Next.3.4.8.156\lib\net40\WebSharper.UI.Next.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.UI.Next.3.4.8.156\lib\net40\WebSharper.UI.Next.Templating.dll" -r:"\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\lib\net40\WebSharper.Web.dll" --target:library --warn:3 --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- --sqmsessionguid:9ea02008-985a-4196-a958-a795db92a481 "C:\Users\srid\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" Client.fs Global.asax.fs
\\psf\home\documents\visual studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\build\WebSharper.targets(57,5): error MSB4036: The "WebSharperTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin" directory.
Done building project "UINextApplication1.fsproj" -- FAILED.
更新:该WebSharper.targets
文件确实有这个 dll 参考:
<WebSharperTaskAssembly Condition=" '$(WebSharperTaskAssembly)' == '' ">$(MSBuildThisFileDirectory)/../tools/net40/WebSharper.MSBuild.dll</WebSharperTaskAssembly>
并且引用的 dll(上图)按预期存在于此目录下:\\psf\Home\Documents\Visual Studio 2015\Projects\UINextApplication1\packages\WebSharper.3.4.8.187\tools\net40
.
那个“\psf”可能是因为我在 Mac 上使用 Parallels 10 运行 Windows。也许这就是罪魁祸首?