1
Vote

AjaxMin error on compile Release mode

description

I use VS2013 and AjaxMin 5.14.5506.26196. My AjaxMin configuration:
<UsingTask TaskName="AjaxMin" AssemblyFile="$(SolutionDir)\packages\AjaxMin.5.14.5506.26202\tools\net40\AjaxMinTask.dll" />  
  <Target Name="AfterBuild" Condition="'$(ConfigurationName)'=='Release'">
    <ItemGroup>
      <JS Include="**\*.js" Exclude="**\*.min.js;obj\**\*.*" />
      <CSS Include="**\*.css" Exclude="**\*.min.css;obj\**\*.*" />
    </ItemGroup>
    <AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".jsMIN" CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".cssMIN"/>
  </Target>
  <PropertyGroup>
    <CopyAllFilesToSingleFolderForPackageDependsOn>
      CustomCollectFiles;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    </CopyAllFilesToSingleFolderForPackageDependsOn>
  </PropertyGroup>
  <Target Name="CustomCollectFiles">
    <ItemGroup>
      <MinJS Include="**\*.jsMIN" />
      <FilesForPackagingFromProject Include="%(MinJS.Identity)">
        <DestinationRelativePath>%(RecursiveDir)%(Filename).js</DestinationRelativePath>
      </FilesForPackagingFromProject>
      <MinCSS Include="**\*.cssMIN" />
      <FilesForPackagingFromProject Include="%(MinCSS.Identity)">
        <DestinationRelativePath>%(RecursiveDir)%(Filename).css</DestinationRelativePath>
      </FilesForPackagingFromProject>
    </ItemGroup>
  </Target>
I use VS2013 and AjaxMin 5.14.5506.26196. My AjaxMin configuration:
<UsingTask TaskName="AjaxMin" AssemblyFile="$(SolutionDir)\packages\AjaxMin.5.14.5506.26202\tools\net40\AjaxMinTask.dll" />  
  <Target Name="AfterBuild" Condition="'$(ConfigurationName)'=='Release'">
    <ItemGroup>
      <JS Include="**\*.js" Exclude="**\*.min.js;obj\**\*.*" />
      <CSS Include="**\*.css" Exclude="**\*.min.css;obj\**\*.*" />
    </ItemGroup>
    <AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".jsMIN" CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".cssMIN"/>
  </Target>
  <PropertyGroup>
    <CopyAllFilesToSingleFolderForPackageDependsOn>
      CustomCollectFiles;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    </CopyAllFilesToSingleFolderForPackageDependsOn>
  </PropertyGroup>
  <Target Name="CustomCollectFiles">
    <ItemGroup>
      <MinJS Include="**\*.jsMIN" />
      <FilesForPackagingFromProject Include="%(MinJS.Identity)">
        <DestinationRelativePath>%(RecursiveDir)%(Filename).js</DestinationRelativePath>
      </FilesForPackagingFromProject>
      <MinCSS Include="**\*.cssMIN" />
      <FilesForPackagingFromProject Include="%(MinCSS.Identity)">
        <DestinationRelativePath>%(RecursiveDir)%(Filename).css</DestinationRelativePath>
      </FilesForPackagingFromProject>
    </ItemGroup>
  </Target>
When I try compile in release mode I have bellow error:
Error    8   The "AjaxMin" task failed unexpectedly.
System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
   at System.IO.FileInfo..ctor(String fileName)
   at Microsoft.Ajax.Minifier.Tasks.AjaxMin.FileIsWritable(String path)
   at Microsoft.Ajax.Minifier.Tasks.AjaxMin.MinifyJavaScript()
   at Microsoft.Ajax.Minifier.Tasks.AjaxMin.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
But when I comment below row compilation without error:
<AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".jsMIN" CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".cssMIN"/>
Someone faced with such a problem?

Thank you in advance.

comments