我正在添加ReactJS到一个新的ASP。. NET MVC网站,我一直在工作。从NuGet中,我安装了"ReactJS"。Net (MVC 4和5)"包。
当我尝试运行代码时,我得到指向TransformJsx的错误。project on element "TransformJsx"
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="TransformJsx">
<!-- ReactJS.NET - Transforms JSX to JavaScript -->
<UsingTask AssemblyFile="$(OutputPath)React.MSBuild.dll" TaskName="TransformJsx" />
<Target Name="TransformJsx">
<TransformJsx SourceDir="$(MSBuildProjectDirectory)" />
</Target>
</Project>
错误如下
- "TransformJsx"任务意外失败。C:Users310171329DocumentsVisual Studio 2013ProjectsTeamManagementTeamManagementTransformJsx。项目6 3团队管理
- React.Exceptions。JsxException: Parse Error: Line 9: Unexpected token> (at Line 9 column 25) --> JavaScriptEngineSwitcher.Core.JsRuntimeException: Parse Error: Line 9: Unexpected token> (at Line 9 column 25) --> MsieJavaScriptEngine。JsRuntimeException: Parse Error: Line 9: Unexpected token> (at Line 9 column 25) C:Users310171329DocumentsVisual Studio 2013ProjectsTeamManagementTeamManagementTransformJsx。项目6 3团队管理
如有任何帮助,不胜感激
这通常意味着JavaScript文件中有语法错误。你有没有试着看看.js文件的第9行第25个字符是什么?