【发布时间】:2014-05-06 14:29:34
【问题描述】:
我已经从http://sourceforge.net/projects/sourcecookifier/files/other%20plugins/NppPlugin.NET.v0.5.zip/download下载了用于 .NET 的 notepad++ 插件
当我尝试构建我的解决方案时,它给出了以下错误:
The "DllExportTask" task failed unexpectedly.
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength,Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at NppPlugin.DllExport.MSBuild.DllExportTask.TrySearchToolPath(String toolPath, String toolFilename, String& value)
at NppPlugin.DllExport.MSBuild.DllExportTask.ValidateInputValues()
at NppPlugin.DllExport.MSBuild.DllExportTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() NppManagedPluginDemo.VS2010
从代码分析可以看出,无效路径位于NppPlugin.DllExport.targets(4,5),文件内容为:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="NppPlugin.DllExport.MSBuild.DllExportTask" AssemblyFile="NppPlugin.DllExport.MSBuild.dll"/>
<Target Name="AfterBuild" DependsOnTargets="GetFrameworkPaths">
<DllExportTask Platform="$(Platform)"
PlatformTarget="$(PlatformTarget)"
CpuType="$(CpuType)"
EmitDebugSymbols="$(DebugSymbols)"
DllExportAttributeAssemblyName="$(DllExportAttributeAssemblyName)"
DllExportAttributeFullName="$(DllExportAttributeFullName)"
Timeout="$(DllExportTimeout)"
KeyContainer="$(KeyContainerName)$(AssemblyKeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
ProjectDirectory="$(MSBuildProjectDirectory)"
InputFileName="$(TargetPath)"
FrameworkPath="$(TargetedFrameworkDir);$(TargetFrameworkDirectory)"
LibToolPath="$(DevEnvDir)\..\..\VC\bin"
LibToolDllPath="$(DevEnvDir)"
SdkPath="$(FrameworkSDKDir)"/>
</Target>
</Project>
看来 $(Platform) 宏是无效的。如何修复此错误以构建我的解决方案?我正在使用 VS 2013 express for desktop 来构建我的解决方案。
【问题讨论】:
-
"$(Platform) 是当前项目平台的名称(例如,"Win32")。"您的项目是否设置了构建平台?
-
我遇到同样的构建失败,但我认为这是因为
$(TargetedFrameworkDir);包含双反斜杠(即\\),构建日志显示Task Parameter:FrameworkPath=C:\Windows\Microsoft.NET\Framework\\v4.5;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\;;;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\ (TaskId:44)