dotnet/msbuild

can't use enum parameter type from arbitrary assembly

Open

#316 创建于 2015年10月23日

在 GitHub 查看
 (1 评论) (1 反应) (1 负责人)C# (1,364 fork)batch import
help wantedtriaged

仓库指标

Star
 (5,062 star)
PR 合并指标
 (平均合并 11天 7小时) (30 天内合并 125 个 PR)

描述

I have a custom msbuild task that specifies a public parameter of an enum type (CompressionLevel). msbuild rejects the parameter, even though the assembly reference is listed.

D:\CustomTasks.proj(52,25): error MSB4022: The result "System.IO.Compression.CompressionLevel" of evaluating the value "System.IO.Compression.CompressionLevel" of the "ParameterType" attribute in element <Parameter> is not valid. 
<UsingTask TaskName="ZipDirectory" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
 <ParameterGroup>
  <Directory ParameterType="System.String" Required="True"/>
  <DestinationZipFile ParameterType="System.String" Required="True"/>
  <CompressionLevel ParameterType="System.IO.Compression.CompressionLevel" />
 </ParameterGroup>
 <Task>
  <Reference Include="System.IO.Compression.FileSystem"/>
  <Code Source="$(BuildScriptsDirectory)\ZipDirectory.cs"/>
 </Task>
</UsingTask>

贡献者指南