Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path used for inline task reference is not honored #594

Closed
Sarabeth-Jaffe-Microsoft opened this issue Apr 28, 2016 · 1 comment
Closed

Comments

@Sarabeth-Jaffe-Microsoft
Copy link
Contributor

The path specified in a reference is respected during compilation, but not during execution.

Repro Steps: Create an inline task, add a reference to a non-standard assembly and attempt to use it in a code fragment.

This bug has also been reported on StackOverflow.

Code that reproduces the error:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="TestBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask TaskName="Hello" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
    <ParameterGroup />
    <Task>
      <Reference Include="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.XmlTransform.dll"/>
      <Reference Include="System.Xml" />
      <Code Type="Fragment" Language="cs">
        <![CDATA[
          var f = new Microsoft.Web.XmlTransform.XmlTransformationException("test");
          Log.LogMessage("test: " + f.Message);  
        ]]>
      </Code>
    </Task>
  </UsingTask>
  <Target Name="TestBuild">
    <Hello />
  </Target>
</Project>
@nigelgbanks
Copy link

This is still an issue if using RoslynCodeTaskFactory.
error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly

But it does work with CodeTaskFactory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants