Powershell MSBuild Task Output task not working

Mar 23, 2012 at 12:01 PM

I need to read in the contents of a file and then have MSBuild access it. I am doing the following:

<UsingTask TaskName="Output" AssemblyName = "$(MSBuildExtensionsPath)\PowershellTask\PowershellMSBuildTask.dll"  />

<PropertyGroup>
         <TaskItemsScript>$parameters =(Get-Content c:\temp\sql.txt)</TaskItemsScript>
    </PropertyGroup> 

    <Target Name="TaskItems">
<message text="param:$parameters "/>
        <Powershell Script="$(TaskItemsScript)" />
<message text="param:$parameters "/>
<Output TaskParameter="Output" PropertyName="ScriptOutput"/>
<Message Lines="$(ScriptOutput)"/>

     </Target>

I get:

 

c:\Builds\Main\Main_SQL\Sources\SQL.csproj (127): The "Output" task could not be loaded from the assembly C:\Program Files\MSBuild\PowershellTask\PowershellMSBuildTask.dll. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.